deployment-dolphinscheduler-frontend.yaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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" . }}-frontend
  21. labels:
  22. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-frontend
  23. app.kubernetes.io/instance: {{ .Release.Name }}
  24. app.kubernetes.io/managed-by: {{ .Release.Service }}
  25. app.kubernetes.io/component: frontend
  26. spec:
  27. replicas: {{ .Values.frontend.replicas }}
  28. selector:
  29. matchLabels:
  30. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-frontend
  31. app.kubernetes.io/instance: {{ .Release.Name }}
  32. app.kubernetes.io/managed-by: {{ .Release.Service }}
  33. app.kubernetes.io/component: frontend
  34. strategy:
  35. type: {{ .Values.frontend.strategy.type | quote }}
  36. rollingUpdate:
  37. maxSurge: {{ .Values.frontend.strategy.rollingUpdate.maxSurge | quote }}
  38. maxUnavailable: {{ .Values.frontend.strategy.rollingUpdate.maxUnavailable | quote }}
  39. template:
  40. metadata:
  41. labels:
  42. app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-frontend
  43. app.kubernetes.io/instance: {{ .Release.Name }}
  44. app.kubernetes.io/managed-by: {{ .Release.Service }}
  45. app.kubernetes.io/component: frontend
  46. {{- if .Values.alert.annotations }}
  47. annotations:
  48. {{- toYaml .Values.alert.annotations | nindent 8 }}
  49. {{- end }}
  50. spec:
  51. {{- if .Values.frontend.affinity }}
  52. affinity: {{- toYaml .Values.frontend.affinity | nindent 8 }}
  53. {{- end }}
  54. {{- if .Values.frontend.nodeSelector }}
  55. nodeSelector: {{- toYaml .Values.frontend.nodeSelector | nindent 8 }}
  56. {{- end }}
  57. {{- if .Values.frontend.tolerations }}
  58. tolerations: {{- toYaml . | nindent 8 }}
  59. {{- end }}
  60. {{- if .Values.image.pullSecrets }}
  61. imagePullSecrets:
  62. - name: {{ include "dolphinscheduler.image.pullSecrets" . }}
  63. {{- end }}
  64. containers:
  65. - name: {{ include "dolphinscheduler.fullname" . }}-frontend
  66. image: {{ include "dolphinscheduler.image.repository" . | quote }}
  67. args:
  68. - "frontend"
  69. ports:
  70. - containerPort: 8888
  71. name: tcp-port
  72. imagePullPolicy: {{ .Values.image.pullPolicy }}
  73. env:
  74. - name: TZ
  75. value: {{ .Values.timezone }}
  76. - name: FRONTEND_API_SERVER_HOST
  77. value: '{{ include "dolphinscheduler.fullname" . }}-api'
  78. - name: FRONTEND_API_SERVER_PORT
  79. value: "12345"
  80. {{- if .Values.frontend.resources }}
  81. resources:
  82. limits:
  83. memory: {{ .Values.frontend.resources.limits.memory | quote }}
  84. cpu: {{ .Values.frontend.resources.limits.cpu | quote }}
  85. requests:
  86. memory: {{ .Values.frontend.resources.requests.memory | quote }}
  87. cpu: {{ .Values.frontend.resources.requests.cpu | quote }}
  88. {{- end }}
  89. {{- if .Values.frontend.livenessProbe.enabled }}
  90. livenessProbe:
  91. tcpSocket:
  92. port: 8888
  93. initialDelaySeconds: {{ .Values.frontend.livenessProbe.initialDelaySeconds }}
  94. periodSeconds: {{ .Values.frontend.livenessProbe.periodSeconds }}
  95. timeoutSeconds: {{ .Values.frontend.livenessProbe.timeoutSeconds }}
  96. successThreshold: {{ .Values.frontend.livenessProbe.successThreshold }}
  97. failureThreshold: {{ .Values.frontend.livenessProbe.failureThreshold }}
  98. {{- end }}
  99. {{- if .Values.frontend.readinessProbe.enabled }}
  100. readinessProbe:
  101. tcpSocket:
  102. port: 8888
  103. initialDelaySeconds: {{ .Values.frontend.readinessProbe.initialDelaySeconds }}
  104. periodSeconds: {{ .Values.frontend.readinessProbe.periodSeconds }}
  105. timeoutSeconds: {{ .Values.frontend.readinessProbe.timeoutSeconds }}
  106. successThreshold: {{ .Values.frontend.readinessProbe.successThreshold }}
  107. failureThreshold: {{ .Values.frontend.readinessProbe.failureThreshold }}
  108. {{- end }}
  109. volumeMounts:
  110. - mountPath: "/var/log/nginx"
  111. name: {{ include "dolphinscheduler.fullname" . }}-frontend
  112. volumes:
  113. - name: {{ include "dolphinscheduler.fullname" . }}-frontend
  114. {{- if .Values.frontend.persistentVolumeClaim.enabled }}
  115. persistentVolumeClaim:
  116. claimName: {{ include "dolphinscheduler.fullname" . }}-frontend
  117. {{- else }}
  118. emptyDir: {}
  119. {{- end }}