statefulset-dolphinscheduler-master.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. {{ range $key, $value := .Values.master.env }}
  70. - name: {{ $key }}
  71. value: {{ $value | quote }}
  72. {{ end }}
  73. envFrom:
  74. - configMapRef:
  75. name: {{ include "dolphinscheduler.fullname" . }}-common
  76. {{- if .Values.master.resources }}
  77. resources:
  78. {{- toYaml .Values.master.resources | nindent 12 }}
  79. {{- end }}
  80. {{- if .Values.master.livenessProbe.enabled }}
  81. livenessProbe:
  82. exec:
  83. command: ["curl", "-s", "http://localhost:5679/actuator/health/liveness"]
  84. initialDelaySeconds: {{ .Values.master.livenessProbe.initialDelaySeconds }}
  85. periodSeconds: {{ .Values.master.livenessProbe.periodSeconds }}
  86. timeoutSeconds: {{ .Values.master.livenessProbe.timeoutSeconds }}
  87. successThreshold: {{ .Values.master.livenessProbe.successThreshold }}
  88. failureThreshold: {{ .Values.master.livenessProbe.failureThreshold }}
  89. {{- end }}
  90. {{- if .Values.master.readinessProbe.enabled }}
  91. readinessProbe:
  92. exec:
  93. command: ["curl", "-s", "http://localhost:5679/actuator/health/readiness"]
  94. initialDelaySeconds: {{ .Values.master.readinessProbe.initialDelaySeconds }}
  95. periodSeconds: {{ .Values.master.readinessProbe.periodSeconds }}
  96. timeoutSeconds: {{ .Values.master.readinessProbe.timeoutSeconds }}
  97. successThreshold: {{ .Values.master.readinessProbe.successThreshold }}
  98. failureThreshold: {{ .Values.master.readinessProbe.failureThreshold }}
  99. {{- end }}
  100. volumeMounts:
  101. - mountPath: "/opt/dolphinscheduler/logs"
  102. name: {{ include "dolphinscheduler.fullname" . }}-master
  103. {{- include "dolphinscheduler.sharedStorage.volumeMount" . | nindent 12 }}
  104. - name: config-volume
  105. mountPath: /opt/dolphinscheduler/conf/common.properties
  106. subPath: common_properties
  107. volumes:
  108. - name: {{ include "dolphinscheduler.fullname" . }}-master
  109. {{- if .Values.master.persistentVolumeClaim.enabled }}
  110. persistentVolumeClaim:
  111. claimName: {{ include "dolphinscheduler.fullname" . }}-master
  112. {{- else }}
  113. emptyDir: {}
  114. {{- end }}
  115. {{- include "dolphinscheduler.sharedStorage.volume" . | nindent 8 }}
  116. - name: config-volume
  117. configMap:
  118. name: {{ include "dolphinscheduler.fullname" . }}-configs
  119. {{- if .Values.master.persistentVolumeClaim.enabled }}
  120. volumeClaimTemplates:
  121. - metadata:
  122. name: {{ include "dolphinscheduler.fullname" . }}-master
  123. labels:
  124. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-master
  125. {{- include "dolphinscheduler.common.labels" . | nindent 10 }}
  126. spec:
  127. accessModes:
  128. {{- range .Values.master.persistentVolumeClaim.accessModes }}
  129. - {{ . | quote }}
  130. {{- end }}
  131. storageClassName: {{ .Values.master.persistentVolumeClaim.storageClassName | quote }}
  132. resources:
  133. requests:
  134. storage: {{ .Values.master.persistentVolumeClaim.storage | quote }}
  135. {{- end }}