s.jpg
官方文档:
https://github.com/crawlab-team/crawlab/tree/master/k8s

ns

apiVersion: v1
kind: Namespace
metadata:
  name: crawlab

kubernetes部署mongodb
kubernetes部署redis

crawlab master

svc:

apiVersion: v1
kind: Service
metadata:
  name: crawlab
  namespace: crawlab
spec:
  ports:
  - port: 8080
    targetPort: 8080
    nodePort: 30033
  selector:
    app: crawlab-master
  type: NodePort

StatefulSet:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: crawlab-master
  namespace: crawlab
spec:
  serviceName: crawlab-master
  selector:
    matchLabels:
      app: crawlab-master
  template:
    metadata:
      labels:
        app: crawlab-master
    spec:
      containers:
      - image: tikazyq/crawlab:latest
        imagePullPolicy: Always
        name: crawlab
        env:
        - name: CRAWLAB_SERVER_MASTER
          value: "Y"
        - name: CRAWLAB_MONGO_HOST
          value: "mongo"
        - name: CRAWLAB_REDIS_ADDRESS
          value: "redis"
        - name: CRAWLAB_SETTING_ALLOWREGISTER
          value: "Y"
        - name: CRAWLAB_SERVER_LANG_NODE
          value: "N"
        - name: CRAWLAB_SERVER_LANG_JAVA
          value: "N"
        - name: CRAWLAB_SERVER_LANG_DOTNET
          value: "N"
        - name: CRAWLAB_SERVER_REGISTER_TYPE
          value: "hostname"
        ports:
        - containerPort: 8080
          name: crawlab

crawlab-worker

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: crawlab-worker
  namespace: crawlab
spec:
  serviceName: crawlab-worker
  replicas: 2
  selector:
    matchLabels:
      app: crawlab-worker
  template:
    metadata:
      labels:
        app: crawlab-worker
    spec:
      containers:
      - image: tikazyq/crawlab:latest
        imagePullPolicy: Always
        name: crawlab
        env:
        - name: CRAWLAB_SERVER_MASTER
          value: "N"
        - name: CRAWLAB_MONGO_HOST
          value: "mongo"
        - name: CRAWLAB_REDIS_ADDRESS
          value: "redis"
        - name: CRAWLAB_SERVER_LANG_NODE
          value: "Y"
        - name: CRAWLAB_SERVER_LANG_JAVA
          value: "Y"
        - name: CRAWLAB_SERVER_LANG_DOTNET
          value: "Y"
        - name: CRAWLAB_SERVER_REGISTER_TYPE
          value: "hostname"

visit

http://172.16.0.10:30033
初始用户名/密码: admin/admin

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code