deployment-dolphinscheduler-alert.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. {{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
  71. {{ range $key, $value := .Values.alert.env }}
  72. - name: {{ $key }}
  73. value: {{ $value | quote }}
  74. {{ end }}
  75. envFrom:
  76. - configMapRef:
  77. name: {{ include "dolphinscheduler.fullname" . }}-common
  78. {{- if .Values.alert.resources }}
  79. resources:
  80. {{- toYaml .Values.alert.resources | nindent 12 }}
  81. {{- end }}
  82. {{- if .Values.alert.livenessProbe.enabled }}
  83. livenessProbe:
  84. exec:
  85. command: ["curl", "-s", "http://localhost:50053/actuator/health/liveness"]
  86. initialDelaySeconds: {{ .Values.alert.livenessProbe.initialDelaySeconds }}
  87. periodSeconds: {{ .Values.alert.livenessProbe.periodSeconds }}
  88. timeoutSeconds: {{ .Values.alert.livenessProbe.timeoutSeconds }}
  89. successThreshold: {{ .Values.alert.livenessProbe.successThreshold }}
  90. failureThreshold: {{ .Values.alert.livenessProbe.failureThreshold }}
  91. {{- end }}
  92. {{- if .Values.alert.readinessProbe.enabled }}
  93. readinessProbe:
  94. exec:
  95. command: ["curl", "-s", "http://localhost:50053/actuator/health/readiness"]
  96. initialDelaySeconds: {{ .Values.alert.readinessProbe.initialDelaySeconds }}
  97. periodSeconds: {{ .Values.alert.readinessProbe.periodSeconds }}
  98. timeoutSeconds: {{ .Values.alert.readinessProbe.timeoutSeconds }}
  99. successThreshold: {{ .Values.alert.readinessProbe.successThreshold }}
  100. failureThreshold: {{ .Values.alert.readinessProbe.failureThreshold }}
  101. {{- end }}
  102. volumeMounts:
  103. - mountPath: "/opt/dolphinscheduler/logs"
  104. name: {{ include "dolphinscheduler.fullname" . }}-alert
  105. volumes:
  106. - name: {{ include "dolphinscheduler.fullname" . }}-alert
  107. {{- if .Values.alert.persistentVolumeClaim.enabled }}
  108. persistentVolumeClaim:
  109. claimName: {{ include "dolphinscheduler.fullname" . }}-alert
  110. {{- else }}
  111. emptyDir: {}
  112. {{- end }}