deployment-dolphinscheduler-api.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 .Values.api.annotations }}
  38. annotations:
  39. {{- toYaml .Values.api.annotations | nindent 8 }}
  40. {{- end }}
  41. spec:
  42. {{- if .Values.api.affinity }}
  43. affinity:
  44. {{- toYaml .Values.api.affinity | nindent 8 }}
  45. {{- end }}
  46. {{- if .Values.api.nodeSelector }}
  47. nodeSelector:
  48. {{- toYaml .Values.api.nodeSelector | nindent 8 }}
  49. {{- end }}
  50. {{- if .Values.api.tolerations }}
  51. tolerations:
  52. {{- toYaml .Values.api.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" . }}-api
  60. image: {{ include "dolphinscheduler.image.fullname.api" . }}
  61. imagePullPolicy: {{ .Values.image.pullPolicy }}
  62. ports:
  63. - containerPort: 12345
  64. name: "api-port"
  65. - containerPort: 25333
  66. name: "python-api-port"
  67. env:
  68. - name: TZ
  69. value: {{ .Values.timezone }}
  70. - name: SPRING_JACKSON_TIME_ZONE
  71. value: {{ .Values.timezone }}
  72. {{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
  73. {{- include "dolphinscheduler.registry.env_vars" . | nindent 12 }}
  74. {{- include "dolphinscheduler.fs_s3a.env_vars" . | nindent 12 }}
  75. {{ range $key, $value := .Values.api.env }}
  76. - name: {{ $key }}
  77. value: {{ $value | quote }}
  78. {{ end }}
  79. envFrom:
  80. - configMapRef:
  81. name: {{ include "dolphinscheduler.fullname" . }}-common
  82. {{- if .Values.api.resources }}
  83. resources:
  84. {{- toYaml .Values.api.resources | nindent 12 }}
  85. {{- end }}
  86. {{- if .Values.api.livenessProbe.enabled }}
  87. livenessProbe:
  88. exec:
  89. command: ["curl", "-s", "http://localhost:12345/dolphinscheduler/actuator/health/liveness"]
  90. initialDelaySeconds: {{ .Values.api.livenessProbe.initialDelaySeconds }}
  91. periodSeconds: {{ .Values.api.livenessProbe.periodSeconds }}
  92. timeoutSeconds: {{ .Values.api.livenessProbe.timeoutSeconds }}
  93. successThreshold: {{ .Values.api.livenessProbe.successThreshold }}
  94. failureThreshold: {{ .Values.api.livenessProbe.failureThreshold }}
  95. {{- end }}
  96. {{- if .Values.api.readinessProbe.enabled }}
  97. readinessProbe:
  98. exec:
  99. command: ["curl", "-s", "http://localhost:12345/dolphinscheduler/actuator/health/readiness"]
  100. initialDelaySeconds: {{ .Values.api.readinessProbe.initialDelaySeconds }}
  101. periodSeconds: {{ .Values.api.readinessProbe.periodSeconds }}
  102. timeoutSeconds: {{ .Values.api.readinessProbe.timeoutSeconds }}
  103. successThreshold: {{ .Values.api.readinessProbe.successThreshold }}
  104. failureThreshold: {{ .Values.api.readinessProbe.failureThreshold }}
  105. {{- end }}
  106. volumeMounts:
  107. - mountPath: "/opt/dolphinscheduler/logs"
  108. name: {{ include "dolphinscheduler.fullname" . }}-api
  109. - name: config-volume
  110. mountPath: /opt/dolphinscheduler/conf/common.properties
  111. subPath: common_properties
  112. {{- include "dolphinscheduler.sharedStorage.volumeMount" . | nindent 12 }}
  113. {{- include "dolphinscheduler.fsFileResource.volumeMount" . | nindent 12 }}
  114. volumes:
  115. - name: {{ include "dolphinscheduler.fullname" . }}-api
  116. {{- if .Values.api.persistentVolumeClaim.enabled }}
  117. persistentVolumeClaim:
  118. claimName: {{ include "dolphinscheduler.fullname" . }}-api
  119. {{- else }}
  120. emptyDir: {}
  121. {{- end }}
  122. - name: config-volume
  123. configMap:
  124. name: {{ include "dolphinscheduler.fullname" . }}-configs
  125. {{- include "dolphinscheduler.sharedStorage.volume" . | nindent 8 }}
  126. {{- include "dolphinscheduler.fsFileResource.volume" . | nindent 8 }}