deployment-dolphinscheduler-api.yaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. {{ range $key, $value := .Values.api.env }}
  75. - name: {{ $key }}
  76. value: {{ $value | quote }}
  77. {{ end }}
  78. envFrom:
  79. - configMapRef:
  80. name: {{ include "dolphinscheduler.fullname" . }}-common
  81. {{- if .Values.api.resources }}
  82. resources:
  83. {{- toYaml .Values.api.resources | nindent 12 }}
  84. {{- end }}
  85. {{- if .Values.api.livenessProbe.enabled }}
  86. livenessProbe:
  87. exec:
  88. command: ["curl", "-s", "http://localhost:12345/dolphinscheduler/actuator/health/liveness"]
  89. initialDelaySeconds: {{ .Values.api.livenessProbe.initialDelaySeconds }}
  90. periodSeconds: {{ .Values.api.livenessProbe.periodSeconds }}
  91. timeoutSeconds: {{ .Values.api.livenessProbe.timeoutSeconds }}
  92. successThreshold: {{ .Values.api.livenessProbe.successThreshold }}
  93. failureThreshold: {{ .Values.api.livenessProbe.failureThreshold }}
  94. {{- end }}
  95. {{- if .Values.api.readinessProbe.enabled }}
  96. readinessProbe:
  97. exec:
  98. command: ["curl", "-s", "http://localhost:12345/dolphinscheduler/actuator/health/readiness"]
  99. initialDelaySeconds: {{ .Values.api.readinessProbe.initialDelaySeconds }}
  100. periodSeconds: {{ .Values.api.readinessProbe.periodSeconds }}
  101. timeoutSeconds: {{ .Values.api.readinessProbe.timeoutSeconds }}
  102. successThreshold: {{ .Values.api.readinessProbe.successThreshold }}
  103. failureThreshold: {{ .Values.api.readinessProbe.failureThreshold }}
  104. {{- end }}
  105. volumeMounts:
  106. - mountPath: "/opt/dolphinscheduler/logs"
  107. name: {{ include "dolphinscheduler.fullname" . }}-api
  108. - name: config-volume
  109. mountPath: /opt/dolphinscheduler/conf/common.properties
  110. subPath: common_properties
  111. {{- include "dolphinscheduler.sharedStorage.volumeMount" . | nindent 12 }}
  112. {{- include "dolphinscheduler.fsFileResource.volumeMount" . | nindent 12 }}
  113. volumes:
  114. - name: {{ include "dolphinscheduler.fullname" . }}-api
  115. {{- if .Values.api.persistentVolumeClaim.enabled }}
  116. persistentVolumeClaim:
  117. claimName: {{ include "dolphinscheduler.fullname" . }}-api
  118. {{- else }}
  119. emptyDir: {}
  120. {{- end }}
  121. - name: config-volume
  122. configMap:
  123. name: {{ include "dolphinscheduler.fullname" . }}-configs
  124. {{- include "dolphinscheduler.sharedStorage.volume" . | nindent 8 }}
  125. {{- include "dolphinscheduler.fsFileResource.volume" . | nindent 8 }}