statefulset-dolphinscheduler-master.yaml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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: StatefulSet
  19. metadata:
  20. name: {{ include "dolphinscheduler.fullname" . }}-master
  21. labels:
  22. {{- include "dolphinscheduler.master.labels" . | nindent 4 }}
  23. spec:
  24. podManagementPolicy: {{ .Values.master.podManagementPolicy }}
  25. replicas: {{ .Values.master.replicas }}
  26. selector:
  27. matchLabels:
  28. {{- include "dolphinscheduler.master.labels" . | nindent 6 }}
  29. serviceName: {{ template "dolphinscheduler.fullname" . }}-master-headless
  30. template:
  31. metadata:
  32. labels:
  33. {{- include "dolphinscheduler.master.labels" . | nindent 8 }}
  34. {{- if .Values.master.annotations }}
  35. annotations:
  36. {{- toYaml .Values.master.annotations | nindent 8 }}
  37. {{- end }}
  38. spec:
  39. {{- if .Values.master.affinity }}
  40. affinity:
  41. {{- toYaml .Values.master.affinity | nindent 8 }}
  42. {{- end }}
  43. {{- if .Values.master.nodeSelector }}
  44. nodeSelector:
  45. {{- toYaml .Values.master.nodeSelector | nindent 8 }}
  46. {{- end }}
  47. {{- if .Values.master.tolerations }}
  48. tolerations:
  49. {{- toYaml .Values.master.tolerations | nindent 8 }}
  50. {{- end }}
  51. {{- if .Values.image.pullSecret }}
  52. imagePullSecrets:
  53. - name: {{ .Values.image.pullSecret }}
  54. {{- end }}
  55. containers:
  56. - name: {{ include "dolphinscheduler.fullname" . }}-master
  57. image: {{ include "dolphinscheduler.image.fullname.master" . }}
  58. imagePullPolicy: {{ .Values.image.pullPolicy }}
  59. ports:
  60. - containerPort: 5678
  61. name: "master-port"
  62. env:
  63. - name: TZ
  64. value: {{ .Values.timezone }}
  65. - name: SPRING_JACKSON_TIME_ZONE
  66. value: {{ .Values.timezone }}
  67. {{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
  68. {{- include "dolphinscheduler.registry.env_vars" . | nindent 12 }}
  69. {{- include "dolphinscheduler.fs_s3a.env_vars" . | nindent 12 }}
  70. {{ range $key, $value := .Values.master.env }}
  71. - name: {{ $key }}
  72. value: {{ $value | quote }}
  73. {{ end }}
  74. envFrom:
  75. - configMapRef:
  76. name: {{ include "dolphinscheduler.fullname" . }}-common
  77. {{- if .Values.master.resources }}
  78. resources:
  79. {{- toYaml .Values.master.resources | nindent 12 }}
  80. {{- end }}
  81. {{- if .Values.master.livenessProbe.enabled }}
  82. livenessProbe:
  83. exec:
  84. command: ["curl", "-s", "http://localhost:5679/actuator/health/liveness"]
  85. initialDelaySeconds: {{ .Values.master.livenessProbe.initialDelaySeconds }}
  86. periodSeconds: {{ .Values.master.livenessProbe.periodSeconds }}
  87. timeoutSeconds: {{ .Values.master.livenessProbe.timeoutSeconds }}
  88. successThreshold: {{ .Values.master.livenessProbe.successThreshold }}
  89. failureThreshold: {{ .Values.master.livenessProbe.failureThreshold }}
  90. {{- end }}
  91. {{- if .Values.master.readinessProbe.enabled }}
  92. readinessProbe:
  93. exec:
  94. command: ["curl", "-s", "http://localhost:5679/actuator/health/readiness"]
  95. initialDelaySeconds: {{ .Values.master.readinessProbe.initialDelaySeconds }}
  96. periodSeconds: {{ .Values.master.readinessProbe.periodSeconds }}
  97. timeoutSeconds: {{ .Values.master.readinessProbe.timeoutSeconds }}
  98. successThreshold: {{ .Values.master.readinessProbe.successThreshold }}
  99. failureThreshold: {{ .Values.master.readinessProbe.failureThreshold }}
  100. {{- end }}
  101. volumeMounts:
  102. - mountPath: "/opt/dolphinscheduler/logs"
  103. name: {{ include "dolphinscheduler.fullname" . }}-master
  104. {{- include "dolphinscheduler.sharedStorage.volumeMount" . | nindent 12 }}
  105. - name: config-volume
  106. mountPath: /opt/dolphinscheduler/conf/common.properties
  107. subPath: common_properties
  108. volumes:
  109. - name: {{ include "dolphinscheduler.fullname" . }}-master
  110. {{- if .Values.master.persistentVolumeClaim.enabled }}
  111. persistentVolumeClaim:
  112. claimName: {{ include "dolphinscheduler.fullname" . }}-master
  113. {{- else }}
  114. emptyDir: {}
  115. {{- end }}
  116. {{- include "dolphinscheduler.sharedStorage.volume" . | nindent 8 }}
  117. - name: config-volume
  118. configMap:
  119. name: {{ include "dolphinscheduler.fullname" . }}-configs
  120. {{- if .Values.master.persistentVolumeClaim.enabled }}
  121. volumeClaimTemplates:
  122. - metadata:
  123. name: {{ include "dolphinscheduler.fullname" . }}-master
  124. labels:
  125. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-master
  126. {{- include "dolphinscheduler.common.labels" . | nindent 10 }}
  127. spec:
  128. accessModes:
  129. {{- range .Values.master.persistentVolumeClaim.accessModes }}
  130. - {{ . | quote }}
  131. {{- end }}
  132. storageClassName: {{ .Values.master.persistentVolumeClaim.storageClassName | quote }}
  133. resources:
  134. requests:
  135. storage: {{ .Values.master.persistentVolumeClaim.storage | quote }}
  136. {{- end }}