|
| 1 | +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + labels: {{- include "common.labels.standard" . | nindent 4 }} |
| 5 | + {{- if .Values.commonLabels }} |
| 6 | + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 7 | + {{- end }} |
| 8 | + name: {{ template "common.names.fullname" . }} |
| 9 | + annotations: |
| 10 | + {{- if .Values.commonAnnotations }} |
| 11 | + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} |
| 12 | + {{- end }} |
| 13 | +spec: |
| 14 | + replicas: {{ .Values.replicaCount }} |
| 15 | + {{- if .Values.updateStrategy }} |
| 16 | + strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} |
| 17 | + {{- end }} |
| 18 | + selector: |
| 19 | + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} |
| 20 | + template: |
| 21 | + metadata: |
| 22 | + annotations: |
| 23 | + {{- if or .Values.podAnnotations .Values.metrics.enabled }} |
| 24 | + {{- include "prereg-booking.podAnnotations" . | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + |
| 27 | + labels: {{- include "common.labels.standard" . | nindent 8 }} |
| 28 | + {{- if .Values.podLabels }} |
| 29 | + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + spec: |
| 32 | + serviceAccountName: {{ template "prereg-booking.serviceAccountName" . }} |
| 33 | + {{- include "prereg-booking.imagePullSecrets" . | nindent 6 }} |
| 34 | + {{- if .Values.hostAliases }} |
| 35 | + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} |
| 36 | + {{- end }} |
| 37 | + {{- if .Values.affinity }} |
| 38 | + affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} |
| 39 | + {{- else }} |
| 40 | + affinity: |
| 41 | + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} |
| 42 | + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} |
| 43 | + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} |
| 44 | + {{- end }} |
| 45 | + {{- if .Values.nodeSelector }} |
| 46 | + nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} |
| 47 | + {{- end }} |
| 48 | + {{- if .Values.tolerations }} |
| 49 | + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} |
| 50 | + {{- end }} |
| 51 | + {{- if .Values.priorityClassName }} |
| 52 | + priorityClassName: {{ .Values.priorityClassName | quote }} |
| 53 | + {{- end }} |
| 54 | + {{- if .Values.podSecurityContext.enabled }} |
| 55 | + securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} |
| 56 | + {{- end }} |
| 57 | + initContainers: |
| 58 | + {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} |
| 59 | + - name: volume-permissions |
| 60 | + image: {{ include "prereg-booking.volumePermissions.image" . }} |
| 61 | + imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} |
| 62 | + command: |
| 63 | + - %%commands%% |
| 64 | + securityContext: |
| 65 | + runAsUser: 0 |
| 66 | + {{- if .Values.volumePermissions.resources }} |
| 67 | + resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} |
| 68 | + {{- end }} |
| 69 | + volumeMounts: |
| 70 | + - name: foo |
| 71 | + mountPath: bar |
| 72 | + {{- end }} |
| 73 | + {{- if .Values.initContainers }} |
| 74 | + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} |
| 75 | + {{- end }} |
| 76 | + containers: |
| 77 | + - name: prereg-booking |
| 78 | + image: {{ template "prereg-booking.image" . }} |
| 79 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 80 | + {{- if .Values.lifecycleHooks }} |
| 81 | + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} |
| 82 | + {{- end }} |
| 83 | + {{- if .Values.containerSecurityContext.enabled }} |
| 84 | + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} |
| 85 | + {{- end }} |
| 86 | + {{- if .Values.command }} |
| 87 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} |
| 88 | + {{- end }} |
| 89 | + {{- if .Values.args }} |
| 90 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} |
| 91 | + {{- end }} |
| 92 | + env: |
| 93 | + - name: container_user |
| 94 | + value: {{ .Values.containerSecurityContext.runAsUser }} |
| 95 | + - name: JDK_JAVA_OPTIONS |
| 96 | + value: {{ .Values.additionalResources.javaOpts }} |
| 97 | + {{- if .Values.extraEnvVars }} |
| 98 | + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} |
| 99 | + {{- end }} |
| 100 | + envFrom: |
| 101 | + {{- if .Values.extraEnvVarsCM }} |
| 102 | + {{- range .Values.extraEnvVarsCM }} |
| 103 | + - configMapRef: |
| 104 | + name: {{ . }} |
| 105 | + {{- end }} |
| 106 | + {{- end }} |
| 107 | + {{- if .Values.extraEnvVarsSecret }} |
| 108 | + {{- range .Values.extraEnvVarsSecret }} |
| 109 | + - secretRef: |
| 110 | + name: {{ . }} |
| 111 | + {{- end }} |
| 112 | + {{- end }} |
| 113 | + ports: |
| 114 | + - name: spring-service |
| 115 | + containerPort: {{ .Values.springServicePort }} |
| 116 | + |
| 117 | + {{- if .Values.resources }} |
| 118 | + resources: {{- toYaml .Values.resources | nindent 12 }} |
| 119 | + {{- end }} |
| 120 | + {{- if .Values.startupProbe.enabled }} |
| 121 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} |
| 122 | + {{- else if .Values.customStartupProbe }} |
| 123 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} |
| 124 | + {{- end }} |
| 125 | + {{- if .Values.livenessProbe.enabled }} |
| 126 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} |
| 127 | + {{- else if .Values.customLivenessProbe }} |
| 128 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} |
| 129 | + {{- end }} |
| 130 | + {{- if .Values.readinessProbe.enabled }} |
| 131 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} |
| 132 | + {{- else if .Values.customReadinessProbe }} |
| 133 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} |
| 134 | + {{- end }} |
| 135 | + {{- if .Values.sidecars }} |
| 136 | + {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} |
| 137 | + {{- end }} |
0 commit comments