statefulset-dolphinscheduler-master.yaml 5.5 KB

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