了解更多请参考 Apache DolphinScheduler 官方文档 资料!

https://hub.docker.com/search?q=dolphinscheduler

安装说明

目前,已经整理了 Kubernetes 服务初始化脚本, 可快速完成服务部署!

服务清单

服务名称 服务描述 是否在用 对应脚本 备注
dolphinscheduler-alert DolphinScheduler 告警服务 dolphinscheduler-alert.yaml ETL 消息告警
dolphinscheduler-api DolphinScheduler API 服务 dolphinscheduler-api.yaml 调度中台+控制台
dolphinscheduler-master DolphinScheduler Master 服务 dolphinscheduler-master.yaml 管理节点
dolphinscheduler-worker DolphinScheduler Worker 服务 dolphinscheduler-worker.yaml 工作节点
dolphinscheduler-zookeeper DolphinScheduler Zookeeper服务 dolphinscheduler-zookeeper.yaml Zookeeper

使用 kubectl 命令部署服务

1、初始化 DolphinScheduler 配置文件
kubectl apply -f dolphinscheduler-config.yaml --namespace=dmp-prod
2、部署/更新 DolphinScheduler 服务(指定命名空间名称)
kubectl apply -f dolphinscheduler-alert.yaml --namespace=dmp-prod;
kubectl apply -f dolphinscheduler-api.yaml --namespace=dmp-prod;
kubectl apply -f dolphinscheduler-zookeeper.yaml --namespace=dmp-prod;
kubectl apply -f dolphinscheduler-master.yaml --namespace=dmp-prod;
kubectl apply -f dolphinscheduler-worker.yaml --namespace=dmp-prod;

DolphinScheduler 配置文件说明

dolphinscheduler-alert.yaml
---
kind: Service
apiVersion: v1
metadata:
  name: dolphinscheduler-alert
  namespace: dmp-prod
  labels:
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-alert
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  ports:
    - name: alert-port
      protocol: TCP
      port: 50052
      targetPort: alert-port
    - name: actuator-port
      protocol: TCP
      port: 50053
      targetPort: actuator-port
  selector:
    app.kubernetes.io/component: alert
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-alert
    app.kubernetes.io/version: 3.0.0
  type: ClusterIP
  sessionAffinity: None
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  internalTrafficPolicy: Cluster
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: dolphinscheduler-alert
  namespace: dmp-prod
  labels:
    app.kubernetes.io/component: alert
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-alert
    app.kubernetes.io/version: 3.0.0
  annotations:
    deployment.kubernetes.io/revision: '4'
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: alert
      app.kubernetes.io/instance: dolphinscheduler
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: dolphinscheduler-alert
      app.kubernetes.io/version: 3.0.0
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: alert
        app.kubernetes.io/instance: dolphinscheduler
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: dolphinscheduler-alert
        app.kubernetes.io/version: 3.0.0
    spec:
      volumes:
        - name: dolphinscheduler-alert
          emptyDir: {}
      containers:
        - name: dolphinscheduler-alert
          image: >-
            apache/dolphinscheduler-alert-server:latest
          ports:
            - name: alert-port
              containerPort: 50052
              protocol: TCP
            - name: actuator-port
              containerPort: 50053
              protocol: TCP
          envFrom:
            - configMapRef:
                name: dolphinscheduler-common
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: SPRING_JACKSON_TIME_ZONE
              value: Asia/Shanghai
            - name: DATABASE
              value: mysql
            - name: SPRING_DATASOURCE_URL
              value: >-
                jdbc:mysql://192.168.3.91:13306/dolphinscheduler?characterEncoding=utf8&useSSL=false
            - name: SPRING_DATASOURCE_USERNAME
              value: dmp_dolphinscheduler
            - name: SPRING_DATASOURCE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: dolphinscheduler-externaldb
                  key: database-password
            - name: JAVA_OPTS
              value: '-Xms512m -Xmx512m -Xmn256m'
          resources: {}
          volumeMounts:
            - name: dolphinscheduler-alert
              mountPath: /opt/dolphinscheduler/logs
          livenessProbe:
            exec:
              command:
                - curl
                - '-s'
                - 'http://localhost:50053/actuator/health/liveness'
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            exec:
              command:
                - curl
                - '-s'
                - 'http://localhost:50053/actuator/health/readiness'
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
dolphinscheduler-api.yaml
---
kind: Service
apiVersion: v1
metadata:
  name: dolphinscheduler-api
  namespace: dmp-prod
  labels:
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-api
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  ports:
    - name: api-port
      protocol: TCP
      port: 12345
      targetPort: api-port
      nodePort: 31313
    - name: python-api-port
      protocol: TCP
      port: 25333
      targetPort: python-api-port
      nodePort: 30566
  selector:
    app.kubernetes.io/component: api
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-api
    app.kubernetes.io/version: 3.0.0
  type: NodePort
  sessionAffinity: None
  externalTrafficPolicy: Cluster
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  internalTrafficPolicy: Cluster
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: dolphinscheduler-api
  namespace: dmp-prod
  labels:
    app.kubernetes.io/component: api
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-api
    app.kubernetes.io/version: 3.0.0
  annotations:
    deployment.kubernetes.io/revision: '12'
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: api
      app.kubernetes.io/instance: dolphinscheduler
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: dolphinscheduler-api
      app.kubernetes.io/version: 3.0.0
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: api
        app.kubernetes.io/instance: dolphinscheduler
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: dolphinscheduler-api
        app.kubernetes.io/version: 3.0.0
    spec:
      volumes:
        - name: dolphinscheduler-api
          emptyDir: {}
      containers:
        - name: dolphinscheduler-api
          image: >-
            apache/dolphinscheduler-api:latest
          ports:
            - name: api-port
              containerPort: 12345
              protocol: TCP
            - name: python-api-port
              containerPort: 25333
              protocol: TCP
          envFrom:
            - configMapRef:
                name: dolphinscheduler-common
          env:
            - name: CAS_CLIENT_PREFIX
              value: 'https://bmp.91118.com'
            - name: CAS_CLIENT_LOGIN
              value: 'https://bmp.91118.com/etl/login/cas'
            - name: CAS_CLIENT_LOGOUTRELATIVE
              value: /etl/logout/cas
            - name: CAS_CLIENT_LOGOUT
              value: 'https://bmp.91118.com/etl/logout/cas'
            - name: CAS_CLIENT_FRONTURL
              value: 'https://bmp.91118.com/etl/ui/transition'
            - name: CAS_SERVER_PREFIX
              value: 'https://ca.91118.com'
            - name: CAS_SERVER_LOGIN
              value: 'https://ca.91118.com/login'
            - name: CAS_SERVER_LOGOUT
              value: 'https://ca.91118.com/logout'
            - name: TZ
              value: Asia/Shanghai
            - name: SPRING_JACKSON_TIME_ZONE
              value: Asia/Shanghai
            - name: DATABASE
              value: mysql
            - name: SPRING_DATASOURCE_URL
              value: >-
                jdbc:mysql://192.168.3.91:13306/dolphinscheduler?characterEncoding=utf8&useSSL=false
            - name: SPRING_DATASOURCE_USERNAME
              value: dmp_dolphinscheduler
            - name: SPRING_DATASOURCE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: dolphinscheduler-externaldb
                  key: database-password
            - name: REGISTRY_TYPE
              value: zookeeper
            - name: REGISTRY_ZOOKEEPER_CONNECT_STRING
              value: 'dolphinscheduler-zookeeper:2181'
            - name: FS_S3A_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: dolphinscheduler-fs-s3a
                  key: fs-s3a-secret-key
            - name: JAVA_OPTS
              value: '-Xms512m -Xmx512m -Xmn256m'
          resources: {}
          volumeMounts:
            - name: dolphinscheduler-api
              mountPath: /opt/dolphinscheduler/logs
          livenessProbe:
            exec:
              command:
                - curl
                - '-s'
                - >-
                  http://localhost:12345/dolphinscheduler/actuator/health/liveness
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            exec:
              command:
                - curl
                - '-s'
                - >-
                  http://localhost:12345/dolphinscheduler/actuator/health/readiness
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
dolphinscheduler-config.yaml
---
kind: ConfigMap
apiVersion: v1
metadata:
  name: dolphinscheduler-common
  namespace: dmp-prod
  labels:
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-common
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
data:
  DATASOURCE_ENCRYPTION_ENABLE: 'false'
  DATASOURCE_ENCRYPTION_SALT: '!@#$%^&*'
  DATAX_HOME: /opt/soft/datax
  DATA_BASEDIR_PATH: /tmp/dolphinscheduler
  DOLPHINSCHEDULER_OPTS: ''
  FLINK_HOME: /opt/soft/flink
  FS_DEFAULT_FS: 's3a:///dolphinscheduler'
  FS_S3A_ACCESS_KEY: YOURACCESSKEY
  FS_S3A_ENDPOINT: 'http://10.233.92.168:9000'
  HADOOP_CONF_DIR: /opt/soft/hadoop/etc/hadoop
  HADOOP_HOME: /opt/soft/hadoop
  HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE: 'false'
  HDFS_ROOT_USER: hdfs
  HIVE_HOME: /opt/soft/hive
  JAVA_HOME: /usr/local/openjdk-8
  JAVA_SECURITY_KRB5_CONF_PATH: /opt/krb5.conf
  KERBEROS_EXPIRE_TIME: '2'
  LOGIN_USER_KEYTAB_PATH: /opt/hdfs.keytab
  LOGIN_USER_KEYTAB_USERNAME: hdfs@HADOOP.COM
  PYTHON_HOME: /usr/bin/python
  RESOURCE_MANAGER_HTTPADDRESS_PORT: '8088'
  RESOURCE_STORAGE_TYPE: S3
  RESOURCE_UPLOAD_PATH: /dolphinscheduler
  SPARK_HOME1: /opt/soft/spark1
  SPARK_HOME2: /opt/soft/spark2
  SUDO_ENABLE: 'true'
  YARN_APPLICATION_STATUS_ADDRESS: 'http://ds1:%s/ws/v1/cluster/apps/%s'
  YARN_JOB_HISTORY_STATUS_ADDRESS: 'http://ds1:19888/ws/v1/history/mapreduce/jobs/%s'
  YARN_RESOURCEMANAGER_HA_RM_IDS: ''
---
kind: Secret
apiVersion: v1
metadata:
  name: dolphinscheduler-fs-s3a
  namespace: dmp-prod
  labels:
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-fs-s3a
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
data:
  fs-s3a-secret-key: WU9VUkFDQ0VTU0tFWQ==
type: Opaque
---
kind: Secret
apiVersion: v1
metadata:
  name: dolphinscheduler-externaldb
  namespace: dmp-prod
  labels:
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-externaldb
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
data:
  database-password: bjltVWdUNyVYb0VTJnZVIw==
type: Opaque
dolphinscheduler-master.yaml
---
kind: Service
apiVersion: v1
metadata:
  name: dolphinscheduler-master-headless
  namespace: dmp-prod
  labels:
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-master-headless
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  ports:
    - name: master-port
      protocol: TCP
      port: 5678
      targetPort: master-port
  selector:
    app.kubernetes.io/component: master
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-master
    app.kubernetes.io/version: 3.0.0
  clusterIP: None
  clusterIPs:
    - None
  type: ClusterIP
  sessionAffinity: None
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  internalTrafficPolicy: Cluster
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: dolphinscheduler-master
  namespace: dmp-prod
  labels:
    app.kubernetes.io/component: master
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-master
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: master
      app.kubernetes.io/instance: dolphinscheduler
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: dolphinscheduler-master
      app.kubernetes.io/version: 3.0.0
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: master
        app.kubernetes.io/instance: dolphinscheduler
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: dolphinscheduler-master
        app.kubernetes.io/version: 3.0.0
    spec:
      volumes:
        - name: dolphinscheduler-master
          emptyDir: {}
      containers:
        - name: dolphinscheduler-master
          image: >-
            apache/dolphinscheduler-master:latest
          ports:
            - name: master-port
              containerPort: 5678
              protocol: TCP
          envFrom:
            - configMapRef:
                name: dolphinscheduler-common
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: SPRING_JACKSON_TIME_ZONE
              value: Asia/Shanghai
            - name: DATABASE
              value: mysql
            - name: SPRING_DATASOURCE_URL
              value: >-
                jdbc:mysql://192.168.3.91:13306/dolphinscheduler?characterEncoding=utf8&useSSL=false
            - name: SPRING_DATASOURCE_USERNAME
              value: dmp_dolphinscheduler
            - name: SPRING_DATASOURCE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: dolphinscheduler-externaldb
                  key: database-password
            - name: REGISTRY_TYPE
              value: zookeeper
            - name: REGISTRY_ZOOKEEPER_CONNECT_STRING
              value: 'dolphinscheduler-zookeeper:2181'
            - name: FS_S3A_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: dolphinscheduler-fs-s3a
                  key: fs-s3a-secret-key
            - name: JAVA_OPTS
              value: '-Xms1g -Xmx1g -Xmn512m'
            - name: MASTER_DISPATCH_TASK_NUM
              value: '3'
            - name: MASTER_EXEC_TASK_NUM
              value: '20'
            - name: MASTER_EXEC_THREADS
              value: '100'
            - name: MASTER_FAILOVER_INTERVAL
              value: 10m
            - name: MASTER_HEARTBEAT_ERROR_THRESHOLD
              value: '5'
            - name: MASTER_HEARTBEAT_INTERVAL
              value: 10s
            - name: MASTER_HOST_SELECTOR
              value: LowerWeight
            - name: MASTER_KILL_YARN_JOB_WHEN_HANDLE_FAILOVER
              value: 'true'
            - name: MASTER_MAX_CPU_LOAD_AVG
              value: '-1'
            - name: MASTER_RESERVED_MEMORY
              value: '0.3'
            - name: MASTER_STATE_WHEEL_INTERVAL
              value: 5s
            - name: MASTER_TASK_COMMIT_INTERVAL
              value: 1s
            - name: MASTER_TASK_COMMIT_RETRYTIMES
              value: '5'
          resources: {}
          volumeMounts:
            - name: dolphinscheduler-master
              mountPath: /opt/dolphinscheduler/logs
          livenessProbe:
            exec:
              command:
                - curl
                - '-s'
                - 'http://localhost:5679/actuator/health/liveness'
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            exec:
              command:
                - curl
                - '-s'
                - 'http://localhost:5679/actuator/health/readiness'
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
  serviceName: dolphinscheduler-master-headless
  podManagementPolicy: Parallel
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      partition: 0
  revisionHistoryLimit: 10
dolphinscheduler-worker.yaml
---
kind: Service
apiVersion: v1
metadata:
  name: dolphinscheduler-worker-headless
  namespace: dmp-prod
  labels:
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-worker-headless
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  ports:
    - name: worker-port
      protocol: TCP
      port: 1234
      targetPort: worker-port
  selector:
    app.kubernetes.io/component: worker
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-worker
    app.kubernetes.io/version: 3.0.0
  clusterIP: None
  clusterIPs:
    - None
  type: ClusterIP
  sessionAffinity: None
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  internalTrafficPolicy: Cluster
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: dolphinscheduler-worker
  namespace: dmp-prod
  labels:
    app.kubernetes.io/component: worker
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dolphinscheduler-worker
    app.kubernetes.io/version: 3.0.0
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: worker
      app.kubernetes.io/instance: dolphinscheduler
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: dolphinscheduler-worker
      app.kubernetes.io/version: 3.0.0
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: worker
        app.kubernetes.io/instance: dolphinscheduler
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: dolphinscheduler-worker
        app.kubernetes.io/version: 3.0.0
      annotations:
        kubesphere.io/restartedAt: '2023-03-15T01:40:20.483Z'
    spec:
      volumes:
        - name: dolphinscheduler-worker-data
          emptyDir: {}
        - name: dolphinscheduler-worker-logs
          emptyDir: {}
      containers:
        - name: dolphinscheduler-worker
          image: >-
            apache/dolphinscheduler-worker:latest
          ports:
            - name: worker-port
              containerPort: 1234
              protocol: TCP
          envFrom:
            - configMapRef:
                name: dolphinscheduler-common
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: SPRING_JACKSON_TIME_ZONE
              value: Asia/Shanghai
            - name: ALERT_LISTEN_HOST
              value: dolphinscheduler-alert
            - name: DATABASE
              value: mysql
            - name: SPRING_DATASOURCE_URL
              value: >-
                jdbc:mysql://192.168.3.91:13306/dolphinscheduler?characterEncoding=utf8&useSSL=false
            - name: SPRING_DATASOURCE_USERNAME
              value: dmp_dolphinscheduler
            - name: SPRING_DATASOURCE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: dolphinscheduler-externaldb
                  key: database-password
            - name: REGISTRY_TYPE
              value: zookeeper
            - name: REGISTRY_ZOOKEEPER_CONNECT_STRING
              value: 'dolphinscheduler-zookeeper:2181'
            - name: FS_S3A_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: dolphinscheduler-fs-s3a
                  key: fs-s3a-secret-key
            - name: WORKER_EXEC_THREADS
              value: '100'
            - name: WORKER_GROUPS
              value: default
            - name: WORKER_GROUPS_0
              value: default
            - name: WORKER_HEARTBEAT_INTERVAL
              value: 10s
            - name: WORKER_HEART_ERROR_THRESHOLD
              value: '5'
            - name: WORKER_HOST_WEIGHT
              value: '100'
            - name: WORKER_MAX_CPU_LOAD_AVG
              value: '-1'
            - name: WORKER_RESERVED_MEMORY
              value: '0.3'
          resources: {}
          volumeMounts:
            - name: dolphinscheduler-worker-data
              mountPath: /tmp/dolphinscheduler
            - name: dolphinscheduler-worker-logs
              mountPath: /opt/dolphinscheduler/logs
          livenessProbe:
            exec:
              command:
                - curl
                - '-s'
                - 'http://localhost:1235/actuator/health/liveness'
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            exec:
              command:
                - curl
                - '-s'
                - 'http://localhost:1235/actuator/health/readiness'
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
  serviceName: dolphinscheduler-worker-headless
  podManagementPolicy: Parallel
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      partition: 0
  revisionHistoryLimit: 10
dolphinscheduler-zookeeper.yaml
---
kind: Service
apiVersion: v1
metadata:
  name: dolphinscheduler-zookeeper
  namespace: dmp-prod
  labels:
    app.kubernetes.io/component: zookeeper
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: zookeeper
    helm.sh/chart: zookeeper-6.5.3
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  ports:
    - name: tcp-client
      protocol: TCP
      port: 2181
      targetPort: client
    - name: follower
      protocol: TCP
      port: 2888
      targetPort: follower
    - name: tcp-election
      protocol: TCP
      port: 3888
      targetPort: election
  selector:
    app.kubernetes.io/component: zookeeper
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/name: zookeeper
  type: ClusterIP
  sessionAffinity: None
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  internalTrafficPolicy: Cluster
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: dolphinscheduler-zookeeper
  namespace: dmp-prod
  labels:
    app.kubernetes.io/component: zookeeper
    app.kubernetes.io/instance: dolphinscheduler
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: zookeeper
    helm.sh/chart: zookeeper-6.5.3
    role: zookeeper
  annotations:
    meta.helm.sh/release-name: dolphinscheduler
    meta.helm.sh/release-namespace: dmp-prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: zookeeper
      app.kubernetes.io/instance: dolphinscheduler
      app.kubernetes.io/name: zookeeper
  template:
    metadata:
      name: dolphinscheduler-zookeeper
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: zookeeper
        app.kubernetes.io/instance: dolphinscheduler
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: zookeeper
        helm.sh/chart: zookeeper-6.5.3
    spec:
      volumes:
        - name: data
          emptyDir: {}
      containers:
        - name: zookeeper
          image: >-
            aiban-docker.pkg.coding.net/tianyin/base/zookeeper:3.6.2-debian-10-r185
          command:
            - bash
            - '-ec'
            - |
              # Execute entrypoint as usual after obtaining ZOO_SERVER_ID
              # check ZOO_SERVER_ID in persistent volume via myid
              # if not present, set based on POD hostname
              if [[ -f "/bitnami/zookeeper/data/myid" ]]; then
                export ZOO_SERVER_ID="$(cat /bitnami/zookeeper/data/myid)"
              else
                HOSTNAME=`hostname -s`
                if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
                  ORD=${BASH_REMATCH[2]}
                  export ZOO_SERVER_ID=$((ORD + 1 ))
                else
                  echo "Failed to get index from hostname $HOST"
                  exit 1
                fi
              fi
              exec /entrypoint.sh /run.sh
          ports:
            - name: client
              containerPort: 2181
              protocol: TCP
            - name: follower
              containerPort: 2888
              protocol: TCP
            - name: election
              containerPort: 3888
              protocol: TCP
          env:
            - name: ZOO_DATA_LOG_DIR
            - name: ZOO_PORT_NUMBER
              value: '2181'
            - name: ZOO_TICK_TIME
              value: '2000'
            - name: ZOO_INIT_LIMIT
              value: '10'
            - name: ZOO_SYNC_LIMIT
              value: '5'
            - name: ZOO_MAX_CLIENT_CNXNS
              value: '60'
            - name: ZOO_4LW_COMMANDS_WHITELIST
              value: 'srvr,ruok,wchs,cons'
            - name: ZOO_LISTEN_ALLIPS_ENABLED
              value: 'no'
            - name: ZOO_AUTOPURGE_INTERVAL
              value: '0'
            - name: ZOO_AUTOPURGE_RETAIN_COUNT
              value: '3'
            - name: ZOO_MAX_SESSION_TIMEOUT
              value: '40000'
            - name: ZOO_SERVERS
              value: >-
                dolphinscheduler-zookeeper-0.dolphinscheduler-zookeeper-headless.dmp-prod.svc.cluster.local:2888:3888::1
            - name: ZOO_ENABLE_AUTH
              value: 'no'
            - name: ZOO_HEAP_SIZE
              value: '1024'
            - name: ZOO_LOG_LEVEL
              value: ERROR
            - name: ALLOW_ANONYMOUS_LOGIN
              value: 'yes'
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
          resources:
            requests:
              cpu: 250m
              memory: 256Mi
          volumeMounts:
            - name: data
              mountPath: /bitnami/zookeeper
          livenessProbe:
            exec:
              command:
                - /bin/bash
                - '-c'
                - echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 6
          readinessProbe:
            exec:
              command:
                - /bin/bash
                - '-c'
                - echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok
            initialDelaySeconds: 5
            timeoutSeconds: 5
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 6
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
          securityContext:
            runAsUser: 1001
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: default
      serviceAccount: default
      securityContext:
        fsGroup: 1001
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 1
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/component: zookeeper
                    app.kubernetes.io/instance: dolphinscheduler
                    app.kubernetes.io/name: zookeeper
                namespaces:
                  - dmp-prod
                topologyKey: kubernetes.io/hostname
      schedulerName: default-scheduler
  serviceName: dolphinscheduler-zookeeper-headless
  podManagementPolicy: Parallel
  updateStrategy:
    type: RollingUpdate
  revisionHistoryLimit: 10
作者:Jeebiz  创建时间:2023-12-06 11:40
最后编辑:Jeebiz  更新时间:2024-07-10 22:56