deployment-dolphinscheduler-alert.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. {{- if and .Values.alert.enabled }}
  18. apiVersion: apps/v1
  19. kind: Deployment
  20. metadata:
  21. name: {{ include "dolphinscheduler.fullname" . }}-alert
  22. labels:
  23. {{- include "dolphinscheduler.alert.labels" . | nindent 4 }}
  24. spec:
  25. replicas: {{ .Values.alert.replicas }}
  26. selector:
  27. matchLabels:
  28. {{- include "dolphinscheduler.alert.labels" . | nindent 6 }}
  29. strategy:
  30. type: {{ .Values.alert.strategy.type | quote }}
  31. rollingUpdate:
  32. maxSurge: {{ .Values.alert.strategy.rollingUpdate.maxSurge | quote }}
  33. maxUnavailable: {{ .Values.alert.strategy.rollingUpdate.maxUnavailable | quote }}
  34. template:
  35. metadata:
  36. labels:
  37. {{- include "dolphinscheduler.alert.labels" . | nindent 8 }}
  38. {{- if or .Values.alert.annotations .Values.conf.auto }}
  39. annotations:
  40. {{- if .Values.conf.auto }}
  41. checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
  42. {{- end }}
  43. {{- if .Values.alert.annotations }}
  44. {{- toYaml .Values.alert.annotations | nindent 8 }}
  45. {{- end }}
  46. {{- end }}
  47. spec:
  48. serviceAccountName: {{ template "dolphinscheduler.fullname" . }}
  49. {{- if .Values.alert.affinity }}
  50. affinity:
  51. {{- toYaml .Values.alert.affinity | nindent 8 }}
  52. {{- end }}
  53. {{- if .Values.alert.nodeSelector }}
  54. nodeSelector:
  55. {{- toYaml .Values.alert.nodeSelector | nindent 8 }}
  56. {{- end }}
  57. {{- if .Values.alert.tolerations }}
  58. tolerations:
  59. {{- toYaml .Values.alert.tolerations | nindent 8 }}
  60. {{- end }}
  61. {{- if .Values.image.pullSecret }}
  62. imagePullSecrets:
  63. - name: {{ .Values.image.pullSecret }}
  64. {{- end }}
  65. containers:
  66. - name: {{ include "dolphinscheduler.fullname" . }}-alert
  67. image: {{ include "dolphinscheduler.image.fullname.alert" . }}
  68. imagePullPolicy: {{ .Values.image.pullPolicy }}
  69. ports:
  70. - containerPort: 50052
  71. name: "alert-port"
  72. - containerPort: 50053
  73. name: "actuator-port"
  74. env:
  75. - name: TZ
  76. value: {{ .Values.timezone }}
  77. - name: SPRING_JACKSON_TIME_ZONE
  78. value: {{ .Values.timezone }}
  79. {{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
  80. {{- include "dolphinscheduler.registry.env_vars" . | nindent 12 }}
  81. {{ range $key, $value := .Values.alert.env }}
  82. - name: {{ $key }}
  83. value: {{ $value | quote }}
  84. {{ end }}
  85. envFrom:
  86. - configMapRef:
  87. name: {{ include "dolphinscheduler.fullname" . }}-common
  88. {{- if .Values.alert.resources }}
  89. resources:
  90. {{- toYaml .Values.alert.resources | nindent 12 }}
  91. {{- end }}
  92. {{- if .Values.alert.livenessProbe.enabled }}
  93. livenessProbe:
  94. exec:
  95. command: ["curl", "-s", "http://localhost:50053/actuator/health/liveness"]
  96. initialDelaySeconds: {{ .Values.alert.livenessProbe.initialDelaySeconds }}
  97. periodSeconds: {{ .Values.alert.livenessProbe.periodSeconds }}
  98. timeoutSeconds: {{ .Values.alert.livenessProbe.timeoutSeconds }}
  99. successThreshold: {{ .Values.alert.livenessProbe.successThreshold }}
  100. failureThreshold: {{ .Values.alert.livenessProbe.failureThreshold }}
  101. {{- end }}
  102. {{- if .Values.alert.readinessProbe.enabled }}
  103. readinessProbe:
  104. exec:
  105. command: ["curl", "-s", "http://localhost:50053/actuator/health/readiness"]
  106. initialDelaySeconds: {{ .Values.alert.readinessProbe.initialDelaySeconds }}
  107. periodSeconds: {{ .Values.alert.readinessProbe.periodSeconds }}
  108. timeoutSeconds: {{ .Values.alert.readinessProbe.timeoutSeconds }}
  109. successThreshold: {{ .Values.alert.readinessProbe.successThreshold }}
  110. failureThreshold: {{ .Values.alert.readinessProbe.failureThreshold }}
  111. {{- end }}
  112. volumeMounts:
  113. - mountPath: "/opt/dolphinscheduler/logs"
  114. name: {{ include "dolphinscheduler.fullname" . }}-alert
  115. - name: config-volume
  116. mountPath: /opt/dolphinscheduler/conf/common.properties
  117. subPath: common_properties
  118. volumes:
  119. - name: {{ include "dolphinscheduler.fullname" . }}-alert
  120. {{- if .Values.alert.persistentVolumeClaim.enabled }}
  121. persistentVolumeClaim:
  122. claimName: {{ include "dolphinscheduler.fullname" . }}-alert
  123. {{- else }}
  124. emptyDir: {}
  125. {{- end }}
  126. - name: config-volume
  127. configMap:
  128. name: {{ include "dolphinscheduler.fullname" . }}-configs
  129. {{- end }}