123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- #
- # Licensed to the Apache Software Foundation (ASF) under one or more
- # contributor license agreements. See the NOTICE file distributed with
- # this work for additional information regarding copyright ownership.
- # The ASF licenses this file to You under the Apache License, Version 2.0
- # (the "License"); you may not use this file except in compliance with
- # the License. You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- #
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: {{ include "dolphinscheduler.fullname" . }}-api
- labels:
- app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-api
- app.kubernetes.io/instance: {{ .Release.Name }}
- app.kubernetes.io/managed-by: {{ .Release.Service }}
- app.kubernetes.io/component: api
- spec:
- replicas: {{ .Values.api.replicas }}
- selector:
- matchLabels:
- app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-api
- app.kubernetes.io/instance: {{ .Release.Name }}
- app.kubernetes.io/managed-by: {{ .Release.Service }}
- app.kubernetes.io/component: api
- strategy:
- type: {{ .Values.api.strategy.type | quote }}
- rollingUpdate:
- maxSurge: {{ .Values.api.strategy.rollingUpdate.maxSurge | quote }}
- maxUnavailable: {{ .Values.api.strategy.rollingUpdate.maxUnavailable | quote }}
- template:
- metadata:
- labels:
- app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-api
- app.kubernetes.io/instance: {{ .Release.Name }}
- app.kubernetes.io/managed-by: {{ .Release.Service }}
- app.kubernetes.io/component: api
- {{- if .Values.alert.annotations }}
- annotations:
- {{- toYaml .Values.alert.annotations | nindent 8 }}
- {{- end }}
- spec:
- {{- if .Values.api.affinity }}
- affinity: {{- toYaml .Values.api.affinity | nindent 8 }}
- {{- end }}
- {{- if .Values.api.nodeSelector }}
- nodeSelector: {{- toYaml .Values.api.nodeSelector | nindent 8 }}
- {{- end }}
- {{- if .Values.api.tolerations }}
- tolerations: {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- if .Values.image.pullSecret }}
- imagePullSecrets:
- - name: {{ .Values.image.pullSecret }}
- {{- end }}
- containers:
- - name: {{ include "dolphinscheduler.fullname" . }}-api
- image: {{ include "dolphinscheduler.image.fullname" . }}
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- args:
- - "api-server"
- ports:
- - containerPort: 12345
- name: "api-port"
- env:
- - name: TZ
- value: {{ .Values.timezone }}
- - name: DOLPHINSCHEDULER_OPTS
- valueFrom:
- configMapKeyRef:
- key: DOLPHINSCHEDULER_OPTS
- name: {{ include "dolphinscheduler.fullname" . }}-api
- - name: DATABASE_TYPE
- {{- if .Values.postgresql.enabled }}
- value: "postgresql"
- {{- else }}
- value: {{ .Values.externalDatabase.type | quote }}
- {{- end }}
- - name: DATABASE_DRIVER
- {{- if .Values.postgresql.enabled }}
- value: "org.postgresql.Driver"
- {{- else }}
- value: {{ .Values.externalDatabase.driver | quote }}
- {{- end }}
- - name: DATABASE_HOST
- {{- if .Values.postgresql.enabled }}
- value: {{ template "dolphinscheduler.postgresql.fullname" . }}
- {{- else }}
- value: {{ .Values.externalDatabase.host | quote }}
- {{- end }}
- - name: DATABASE_PORT
- {{- if .Values.postgresql.enabled }}
- value: "5432"
- {{- else }}
- value: {{ .Values.externalDatabase.port | quote }}
- {{- end }}
- - name: DATABASE_USERNAME
- {{- if .Values.postgresql.enabled }}
- value: {{ .Values.postgresql.postgresqlUsername }}
- {{- else }}
- value: {{ .Values.externalDatabase.username | quote }}
- {{- end }}
- - name: DATABASE_PASSWORD
- valueFrom:
- secretKeyRef:
- {{- if .Values.postgresql.enabled }}
- name: {{ template "dolphinscheduler.postgresql.fullname" . }}
- key: postgresql-password
- {{- else }}
- name: {{ include "dolphinscheduler.fullname" . }}-externaldb
- key: database-password
- {{- end }}
- - name: DATABASE_DATABASE
- {{- if .Values.postgresql.enabled }}
- value: {{ .Values.postgresql.postgresqlDatabase }}
- {{- else }}
- value: {{ .Values.externalDatabase.database | quote }}
- {{- end }}
- - name: DATABASE_PARAMS
- {{- if .Values.postgresql.enabled }}
- value: "characterEncoding=utf8"
- {{- else }}
- value: {{ .Values.externalDatabase.params | quote }}
- {{- end }}
- - name: ZOOKEEPER_QUORUM
- {{- if .Values.zookeeper.enabled }}
- value: {{ template "dolphinscheduler.zookeeper.quorum" . }}
- {{- else }}
- value: {{ .Values.externalZookeeper.zookeeperQuorum }}
- {{- end }}
- - name: ZOOKEEPER_ROOT
- {{- if .Values.zookeeper.enabled }}
- value: {{ .Values.zookeeper.zookeeperRoot }}
- {{- else }}
- value: {{ .Values.externalZookeeper.zookeeperRoot }}
- {{- end }}
- - name: RESOURCE_STORAGE_TYPE
- valueFrom:
- configMapKeyRef:
- key: RESOURCE_STORAGE_TYPE
- name: {{ include "dolphinscheduler.fullname" . }}-common
- - name: RESOURCE_UPLOAD_PATH
- valueFrom:
- configMapKeyRef:
- key: RESOURCE_UPLOAD_PATH
- name: {{ include "dolphinscheduler.fullname" . }}-common
- - name: FS_DEFAULT_FS
- valueFrom:
- configMapKeyRef:
- key: FS_DEFAULT_FS
- name: {{ include "dolphinscheduler.fullname" . }}-common
- {{- if eq .Values.common.configmap.RESOURCE_STORAGE_TYPE "S3" }}
- - name: FS_S3A_ENDPOINT
- valueFrom:
- configMapKeyRef:
- key: FS_S3A_ENDPOINT
- name: {{ include "dolphinscheduler.fullname" . }}-common
- - name: FS_S3A_ACCESS_KEY
- valueFrom:
- configMapKeyRef:
- key: FS_S3A_ACCESS_KEY
- name: {{ include "dolphinscheduler.fullname" . }}-common
- - name: FS_S3A_SECRET_KEY
- valueFrom:
- secretKeyRef:
- key: fs-s3a-secret-key
- name: {{ include "dolphinscheduler.fullname" . }}-fs-s3a
- {{- end }}
- {{- if .Values.api.resources }}
- resources:
- limits:
- memory: {{ .Values.api.resources.limits.memory | quote }}
- cpu: {{ .Values.api.resources.limits.cpu | quote }}
- requests:
- memory: {{ .Values.api.resources.requests.memory | quote }}
- cpu: {{ .Values.api.resources.requests.cpu | quote }}
- {{- end }}
- {{- if .Values.api.livenessProbe.enabled }}
- livenessProbe:
- tcpSocket:
- port: 12345
- initialDelaySeconds: {{ .Values.api.livenessProbe.initialDelaySeconds }}
- periodSeconds: {{ .Values.api.livenessProbe.periodSeconds }}
- timeoutSeconds: {{ .Values.api.livenessProbe.timeoutSeconds }}
- successThreshold: {{ .Values.api.livenessProbe.successThreshold }}
- failureThreshold: {{ .Values.api.livenessProbe.failureThreshold }}
- {{- end }}
- {{- if .Values.api.readinessProbe.enabled }}
- readinessProbe:
- tcpSocket:
- port: 12345
- initialDelaySeconds: {{ .Values.api.readinessProbe.initialDelaySeconds }}
- periodSeconds: {{ .Values.api.readinessProbe.periodSeconds }}
- timeoutSeconds: {{ .Values.api.readinessProbe.timeoutSeconds }}
- successThreshold: {{ .Values.api.readinessProbe.successThreshold }}
- failureThreshold: {{ .Values.api.readinessProbe.failureThreshold }}
- {{- end }}
- volumeMounts:
- - mountPath: "/opt/dolphinscheduler/logs"
- name: {{ include "dolphinscheduler.fullname" . }}-api
- {{- if .Values.common.fsFileResourcePersistence.enabled }}
- - mountPath: {{ .Values.common.configmap.RESOURCE_UPLOAD_PATH | quote }}
- name: {{ include "dolphinscheduler.fullname" . }}-fs-file
- {{- end }}
- volumes:
- - name: {{ include "dolphinscheduler.fullname" . }}-api
- {{- if .Values.api.persistentVolumeClaim.enabled }}
- persistentVolumeClaim:
- claimName: {{ include "dolphinscheduler.fullname" . }}-api
- {{- else }}
- emptyDir: {}
- {{- end }}
- {{- if .Values.common.fsFileResourcePersistence.enabled }}
- - name: {{ include "dolphinscheduler.fullname" . }}-fs-file
- persistentVolumeClaim:
- claimName: {{ include "dolphinscheduler.fullname" . }}-fs-file
- {{- end }}
|