# # 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" . }}-alert labels: app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-alert app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: alert spec: replicas: {{ .Values.alert.replicas }} selector: matchLabels: app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-alert app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: alert strategy: type: {{ .Values.alert.strategy.type | quote }} rollingUpdate: maxSurge: {{ .Values.alert.strategy.rollingUpdate.maxSurge | quote }} maxUnavailable: {{ .Values.alert.strategy.rollingUpdate.maxUnavailable | quote }} template: metadata: labels: app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-alert app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: alert {{- if .Values.alert.annotations }} annotations: {{- toYaml .Values.alert.annotations | nindent 8 }} {{- end }} spec: {{- if .Values.alert.affinity }} affinity: {{- toYaml .Values.alert.affinity | nindent 8 }} {{- end }} {{- if .Values.alert.nodeSelector }} nodeSelector: {{- toYaml .Values.alert.nodeSelector | nindent 8 }} {{- end }} {{- if .Values.alert.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.image.pullSecret }} imagePullSecrets: - name: {{ .Values.image.pullSecret }} {{- end }} containers: - name: {{ include "dolphinscheduler.fullname" . }}-alert image: {{ include "dolphinscheduler.image.fullname" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} args: - "alert-server" ports: - containerPort: 50052 name: "alert-port" env: - name: TZ value: {{ .Values.timezone }} - name: DOLPHINSCHEDULER_OPTS valueFrom: configMapKeyRef: key: DOLPHINSCHEDULER_OPTS name: {{ include "dolphinscheduler.fullname" . }}-alert - name: ALERT_PLUGIN_DIR valueFrom: configMapKeyRef: key: ALERT_PLUGIN_DIR name: {{ include "dolphinscheduler.fullname" . }}-alert - 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 }} {{- if .Values.alert.resources }} resources: limits: memory: {{ .Values.alert.resources.limits.memory }} cpu: {{ .Values.alert.resources.limits.cpu }} requests: memory: {{ .Values.alert.resources.requests.memory }} cpu: {{ .Values.alert.resources.requests.cpu }} {{- end }} {{- if .Values.alert.livenessProbe.enabled }} livenessProbe: exec: command: - sh - /root/checkpoint.sh - AlertServer initialDelaySeconds: {{ .Values.alert.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.alert.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.alert.livenessProbe.timeoutSeconds }} successThreshold: {{ .Values.alert.livenessProbe.successThreshold }} failureThreshold: {{ .Values.alert.livenessProbe.failureThreshold }} {{- end }} {{- if .Values.alert.readinessProbe.enabled }} readinessProbe: exec: command: - sh - /root/checkpoint.sh - AlertServer initialDelaySeconds: {{ .Values.alert.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.alert.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.alert.readinessProbe.timeoutSeconds }} successThreshold: {{ .Values.alert.readinessProbe.successThreshold }} failureThreshold: {{ .Values.alert.readinessProbe.failureThreshold }} {{- end }} volumeMounts: - mountPath: "/opt/dolphinscheduler/logs" name: {{ include "dolphinscheduler.fullname" . }}-alert volumes: - name: {{ include "dolphinscheduler.fullname" . }}-alert {{- if .Values.alert.persistentVolumeClaim.enabled }} persistentVolumeClaim: claimName: {{ include "dolphinscheduler.fullname" . }}-alert {{- else }} emptyDir: {} {{- end }}