deployment-dolphinscheduler-alert.yaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. apiVersion: apps/v1
  18. kind: Deployment
  19. metadata:
  20. name: {{ include "dolphinscheduler.fullname" . }}-alert
  21. labels:
  22. {{- include "dolphinscheduler.alert.labels" . | nindent 4 }}
  23. spec:
  24. replicas: {{ .Values.alert.replicas }}
  25. selector:
  26. matchLabels:
  27. {{- include "dolphinscheduler.alert.labels" . | nindent 6 }}
  28. strategy:
  29. type: {{ .Values.alert.strategy.type | quote }}
  30. rollingUpdate:
  31. maxSurge: {{ .Values.alert.strategy.rollingUpdate.maxSurge | quote }}
  32. maxUnavailable: {{ .Values.alert.strategy.rollingUpdate.maxUnavailable | quote }}
  33. template:
  34. metadata:
  35. labels:
  36. {{- include "dolphinscheduler.alert.labels" . | nindent 8 }}
  37. {{- if .Values.alert.annotations }}
  38. annotations:
  39. {{- toYaml .Values.alert.annotations | nindent 8 }}
  40. {{- end }}
  41. spec:
  42. {{- if .Values.alert.affinity }}
  43. affinity:
  44. {{- toYaml .Values.alert.affinity | nindent 8 }}
  45. {{- end }}
  46. {{- if .Values.alert.nodeSelector }}
  47. nodeSelector:
  48. {{- toYaml .Values.alert.nodeSelector | nindent 8 }}
  49. {{- end }}
  50. {{- if .Values.alert.tolerations }}
  51. tolerations:
  52. {{- toYaml .Values.alert.tolerations | nindent 8 }}
  53. {{- end }}
  54. {{- if .Values.image.pullSecret }}
  55. imagePullSecrets:
  56. - name: {{ .Values.image.pullSecret }}
  57. {{- end }}
  58. containers:
  59. - name: {{ include "dolphinscheduler.fullname" . }}-alert
  60. image: {{ include "dolphinscheduler.image.fullname.alert" . }}
  61. imagePullPolicy: {{ .Values.image.pullPolicy }}
  62. ports:
  63. - containerPort: 50052
  64. name: "alert-port"
  65. - containerPort: 50053
  66. name: "actuator-port"
  67. env:
  68. - name: TZ
  69. value: {{ .Values.timezone }}
  70. - name: SPRING_JACKSON_TIME_ZONE
  71. value: {{ .Values.timezone }}
  72. {{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
  73. {{ range $key, $value := .Values.alert.env }}
  74. - name: {{ $key }}
  75. value: {{ $value | quote }}
  76. {{ end }}
  77. envFrom:
  78. - configMapRef:
  79. name: {{ include "dolphinscheduler.fullname" . }}-common
  80. {{- if .Values.alert.resources }}
  81. resources:
  82. {{- toYaml .Values.alert.resources | nindent 12 }}
  83. {{- end }}
  84. {{- if .Values.alert.livenessProbe.enabled }}
  85. livenessProbe:
  86. exec:
  87. command: ["curl", "-s", "http://localhost:50053/actuator/health/liveness"]
  88. initialDelaySeconds: {{ .Values.alert.livenessProbe.initialDelaySeconds }}
  89. periodSeconds: {{ .Values.alert.livenessProbe.periodSeconds }}
  90. timeoutSeconds: {{ .Values.alert.livenessProbe.timeoutSeconds }}
  91. successThreshold: {{ .Values.alert.livenessProbe.successThreshold }}
  92. failureThreshold: {{ .Values.alert.livenessProbe.failureThreshold }}
  93. {{- end }}
  94. {{- if .Values.alert.readinessProbe.enabled }}
  95. readinessProbe:
  96. exec:
  97. command: ["curl", "-s", "http://localhost:50053/actuator/health/readiness"]
  98. initialDelaySeconds: {{ .Values.alert.readinessProbe.initialDelaySeconds }}
  99. periodSeconds: {{ .Values.alert.readinessProbe.periodSeconds }}
  100. timeoutSeconds: {{ .Values.alert.readinessProbe.timeoutSeconds }}
  101. successThreshold: {{ .Values.alert.readinessProbe.successThreshold }}
  102. failureThreshold: {{ .Values.alert.readinessProbe.failureThreshold }}
  103. {{- end }}
  104. volumeMounts:
  105. - mountPath: "/opt/dolphinscheduler/logs"
  106. name: {{ include "dolphinscheduler.fullname" . }}-alert
  107. - name: config-volume
  108. mountPath: /opt/dolphinscheduler/conf/common.properties
  109. subPath: common_properties
  110. volumes:
  111. - name: {{ include "dolphinscheduler.fullname" . }}-alert
  112. {{- if .Values.alert.persistentVolumeClaim.enabled }}
  113. persistentVolumeClaim:
  114. claimName: {{ include "dolphinscheduler.fullname" . }}-alert
  115. {{- else }}
  116. emptyDir: {}
  117. {{- end }}
  118. - name: config-volume
  119. configMap:
  120. name: {{ include "dolphinscheduler.fullname" . }}-configs