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