|
| 1 | +{{- /* |
| 2 | +Copyright Drycc Community. |
| 3 | +SPDX-License-Identifier: APACHE-2.0 |
| 4 | +*/}} |
| 5 | + |
| 6 | +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} |
| 7 | +kind: Deployment |
| 8 | +metadata: |
| 9 | + name: {{ include "flink.jobmanager.fullname" . }} |
| 10 | + namespace: {{ include "common.names.namespace" . | quote }} |
| 11 | + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 12 | + app.kubernetes.io/part-of: flink |
| 13 | + app.kubernetes.io/component: jobmanager |
| 14 | + {{- if .Values.commonAnnotations }} |
| 15 | + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} |
| 16 | + {{- end }} |
| 17 | +spec: |
| 18 | + {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.jobmanager.podLabels .Values.commonLabels ) "context" . ) }} |
| 19 | + selector: |
| 20 | + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} |
| 21 | + app.kubernetes.io/part-of: flink |
| 22 | + app.kubernetes.io/component: jobmanager |
| 23 | + replicas: {{ .Values.jobmanager.replicaCount }} |
| 24 | + {{- if .Values.jobmanager.updateStrategy }} |
| 25 | + strategy: {{- toYaml .Values.jobmanager.updateStrategy | nindent 4 }} |
| 26 | + {{- end }} |
| 27 | + template: |
| 28 | + metadata: |
| 29 | + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} |
| 30 | + app.kubernetes.io/part-of: flink |
| 31 | + app.kubernetes.io/component: jobmanager |
| 32 | + {{- if or .Values.jobmanager.podAnnotations .Values.commonAnnotations }} |
| 33 | + {{- $podAnnotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.jobmanager.podAnnotations .Values.commonAnnotations ) "context" . ) }} |
| 34 | + annotations: {{- include "common.tplvalues.render" (dict "value" $podAnnotations "context" $) | nindent 8 }} |
| 35 | + {{- end }} |
| 36 | + spec: |
| 37 | + {{- include "flink.imagePullSecrets" . | nindent 6 }} |
| 38 | + {{- if .Values.jobmanager.schedulerName }} |
| 39 | + schedulerName: {{ .Values.jobmanager.schedulerName }} |
| 40 | + {{- end }} |
| 41 | + priorityClassName: {{ .Values.jobmanager.priorityClassName | quote }} |
| 42 | + {{- if .Values.jobmanager.affinity }} |
| 43 | + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.affinity "context" $) | nindent 8 }} |
| 44 | + {{- else }} |
| 45 | + affinity: |
| 46 | + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobmanager.podAffinityPreset "component" "jobmanager" "customLabels" $podLabels "context" $) | nindent 10 }} |
| 47 | + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobmanager.podAntiAffinityPreset "component" "jobmanager" "customLabels" $podLabels "context" $) | nindent 10 }} |
| 48 | + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.jobmanager.nodeAffinityPreset.type "key" .Values.jobmanager.nodeAffinityPreset.key "values" .Values.jobmanager.nodeAffinityPreset.values) | nindent 10 }} |
| 49 | + {{- end }} |
| 50 | + {{- if .Values.jobmanager.podSecurityContext.enabled }} |
| 51 | + securityContext: {{- omit .Values.jobmanager.podSecurityContext "enabled" | toYaml | nindent 8 }} |
| 52 | + {{- end }} |
| 53 | + {{- if .Values.jobmanager.nodeSelector }} |
| 54 | + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.nodeSelector "context" $) | nindent 8 }} |
| 55 | + {{- end }} |
| 56 | + {{- if .Values.jobmanager.tolerations }} |
| 57 | + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.tolerations "context" $) | nindent 8 }} |
| 58 | + {{- end }} |
| 59 | + {{- if .Values.jobmanager.topologySpreadConstraints }} |
| 60 | + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.topologySpreadConstraints "context" $) | nindent 8 }} |
| 61 | + {{- end }} |
| 62 | + initContainers: |
| 63 | + {{- if .Values.jobmanager.initContainers }} |
| 64 | + {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.initContainers "context" $) | nindent 8 }} |
| 65 | + {{- end }} |
| 66 | + containers: |
| 67 | + - name: flink-jobmanager |
| 68 | + image: {{ include "flink.image" . }} |
| 69 | + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} |
| 70 | + {{- if .Values.jobmanager.containerSecurityContext.enabled }} |
| 71 | + securityContext: {{- omit .Values.jobmanager.containerSecurityContext "enabled" | toYaml | nindent 12 }} |
| 72 | + {{- end }} |
| 73 | + {{- if .Values.diagnosticMode.enabled }} |
| 74 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} |
| 75 | + {{- else if .Values.jobmanager.command }} |
| 76 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.command "context" $) | nindent 12 }} |
| 77 | + {{- end }} |
| 78 | + {{- if .Values.diagnosticMode.enabled }} |
| 79 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} |
| 80 | + {{- else if .Values.jobmanager.args }} |
| 81 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.args "context" $) | nindent 12 }} |
| 82 | + {{- end }} |
| 83 | + {{- if .Values.jobmanager.lifecycleHooks }} |
| 84 | + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.lifecycleHooks "context" $) | nindent 12 }} |
| 85 | + {{- end }} |
| 86 | + ports: |
| 87 | + - name: tcp-rpc |
| 88 | + containerPort: {{ .Values.jobmanager.containerPorts.rpc }} |
| 89 | + - name: http |
| 90 | + containerPort: {{ .Values.jobmanager.containerPorts.http }} |
| 91 | + - name: tcp-blob |
| 92 | + containerPort: {{ .Values.jobmanager.containerPorts.blob }} |
| 93 | + env: |
| 94 | + - name: FLINK_MODE |
| 95 | + value: jobmanager |
| 96 | + - name: FLINK_CFG_JOBMANAGER_RPC_ADDRESS |
| 97 | + value: {{ include "flink.jobmanager.fullname" . | quote }} |
| 98 | + - name: FLINK_CFG_JOBMANAGER_RPC_PORT |
| 99 | + value: {{ .Values.jobmanager.service.ports.rpc | quote }} |
| 100 | + - name: FLINK_CFG_JOBMANAGER_RPC_BIND__PORT |
| 101 | + value: {{ .Values.jobmanager.containerPorts.rpc | quote }} |
| 102 | + - name: FLINK_CFG_JOBMANAGER_BIND__HOST |
| 103 | + value: 0.0.0.0 |
| 104 | + - name: FLINK_CFG_REST_ADDRESS |
| 105 | + value: {{ include "flink.jobmanager.fullname" . | quote }} |
| 106 | + - name: FLINK_CFG_REST_PORT |
| 107 | + value: {{ .Values.jobmanager.containerPorts.http | quote }} |
| 108 | + - name: FLINK_CFG_REST_BIND__ADDRESS |
| 109 | + value: 0.0.0.0 |
| 110 | + - name: FLINK_CFG_BLOB_SERVER_PORT |
| 111 | + value: {{ .Values.jobmanager.containerPorts.blob | quote }} |
| 112 | + - name: DRYCC_DEBUG |
| 113 | + value: {{ ternary "true" "false" .Values.image.debug | quote }} |
| 114 | + {{- if .Values.jobmanager.extraEnvVars }} |
| 115 | + {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.extraEnvVars "context" $) | nindent 12 }} |
| 116 | + {{- end }} |
| 117 | + envFrom: |
| 118 | + {{- if .Values.jobmanager.extraEnvVarsCM }} |
| 119 | + - configMapRef: |
| 120 | + name: {{ .Values.jobmanager.extraEnvVarsCM }} |
| 121 | + {{- end }} |
| 122 | + {{- if .Values.jobmanager.extraEnvVarsSecret }} |
| 123 | + - secretRef: |
| 124 | + name: {{ .Values.jobmanager.extraEnvVarsSecret }} |
| 125 | + {{- end }} |
| 126 | + {{- if not .Values.diagnosticMode.enabled }} |
| 127 | + {{- if .Values.jobmanager.customStartupProbe }} |
| 128 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.customStartupProbe "context" $) | nindent 12 }} |
| 129 | + {{- else if .Values.jobmanager.startupProbe.enabled }} |
| 130 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.jobmanager.startupProbe "enabled") "context" $) | nindent 12 }} |
| 131 | + tcpSocket: |
| 132 | + port: tcp-rpc |
| 133 | + {{- end }} |
| 134 | + {{- if .Values.jobmanager.customLivenessProbe }} |
| 135 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.customLivenessProbe "context" $) | nindent 12 }} |
| 136 | + {{- else if .Values.jobmanager.livenessProbe.enabled }} |
| 137 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.jobmanager.livenessProbe "enabled") "context" $) | nindent 12 }} |
| 138 | + tcpSocket: |
| 139 | + port: tcp-rpc |
| 140 | + {{- end }} |
| 141 | + {{- if .Values.jobmanager.customReadinessProbe }} |
| 142 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.customReadinessProbe "context" $) | nindent 12 }} |
| 143 | + {{- else if .Values.jobmanager.readinessProbe.enabled }} |
| 144 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.jobmanager.readinessProbe "enabled") "context" $) | nindent 12 }} |
| 145 | + tcpSocket: |
| 146 | + port: tcp-rpc |
| 147 | + {{- end }} |
| 148 | + {{- end }} |
| 149 | + {{- if .Values.jobmanager.resources }} |
| 150 | + resources: {{- toYaml .Values.jobmanager.resources | nindent 12 }} |
| 151 | + {{- end }} |
| 152 | + {{- if .Values.jobmanager.extraVolumeMounts }} |
| 153 | + volumeMounts: {{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.extraVolumeMounts "context" $) | nindent 12 }} |
| 154 | + {{- end }} |
| 155 | + {{- if .Values.jobmanager.sidecars }} |
| 156 | + {{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.sidecars "context" $) | nindent 8 }} |
| 157 | + {{- end }} |
| 158 | + volumes: |
| 159 | + {{- if .Values.jobmanager.extraVolumes }} |
| 160 | + {{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.extraVolumes "context" $) | nindent 8 }} |
| 161 | + {{- end }} |
0 commit comments