|
| 1 | +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "common.names.fullname" . }} |
| 5 | + namespace: {{ include "common.names.namespace" . | quote }} |
| 6 | + labels: {{- include "common.labels.standard" . | nindent 4 }} |
| 7 | + {{- if .Values.commonLabels }} |
| 8 | + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 9 | + {{- end }} |
| 10 | + {{- if .Values.commonAnnotations }} |
| 11 | + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} |
| 12 | + {{- end }} |
| 13 | +spec: |
| 14 | + {{- if .Values.updateStrategy }} |
| 15 | + strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} |
| 16 | + {{- end }} |
| 17 | + selector: |
| 18 | + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} |
| 19 | + replicas: {{ .Values.replicaCount }} |
| 20 | + template: |
| 21 | + metadata: |
| 22 | + {{- if .Values.podAnnotations }} |
| 23 | + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} |
| 24 | + {{- end }} |
| 25 | + labels: {{- include "common.labels.standard" . | nindent 8 }} |
| 26 | + {{- if .Values.podLabels }} |
| 27 | + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} |
| 28 | + {{- end }} |
| 29 | + spec: |
| 30 | + serviceAccountName: {{ include "cloudbeaver.serviceAccountName" . }} |
| 31 | + {{- include "cloudbeaver.imagePullSecrets" . | nindent 6 }} |
| 32 | + {{- if .Values.hostAliases }} |
| 33 | + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} |
| 34 | + {{- end }} |
| 35 | + {{- if .Values.affinity }} |
| 36 | + affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} |
| 37 | + {{- else }} |
| 38 | + affinity: |
| 39 | + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} |
| 40 | + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} |
| 41 | + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} |
| 42 | + {{- end }} |
| 43 | + {{- if .Values.nodeSelector }} |
| 44 | + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} |
| 45 | + {{- end }} |
| 46 | + {{- if .Values.tolerations }} |
| 47 | + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }} |
| 48 | + {{- end }} |
| 49 | + {{- if .Values.topologySpreadConstraints }} |
| 50 | + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} |
| 51 | + {{- end }} |
| 52 | + {{- if .Values.priorityClassName }} |
| 53 | + priorityClassName: {{ .Values.priorityClassName | quote }} |
| 54 | + {{- end }} |
| 55 | + {{- if .Values.schedulerName }} |
| 56 | + schedulerName: {{ .Values.schedulerName | quote }} |
| 57 | + {{- end }} |
| 58 | + {{- if .Values.terminationGracePeriodSeconds }} |
| 59 | + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} |
| 60 | + {{- end }} |
| 61 | + {{- if .Values.podSecurityContext.enabled }} |
| 62 | + securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} |
| 63 | + {{- end }} |
| 64 | + containers: |
| 65 | + - name: cloudbeaver |
| 66 | + image: {{ include "cloudbeaver.image" . }} |
| 67 | + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} |
| 68 | + {{- if .Values.containerSecurityContext.enabled }} |
| 69 | + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} |
| 70 | + {{- end }} |
| 71 | + workingDir: /opt/drycc/cloudbeaver/ |
| 72 | + ports: |
| 73 | + - name: http |
| 74 | + containerPort: {{ .Values.containerPorts.http }} |
| 75 | + {{- if not .Values.diagnosticMode.enabled }} |
| 76 | + {{- if .Values.customLivenessProbe }} |
| 77 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} |
| 78 | + {{- else if .Values.livenessProbe.enabled }} |
| 79 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit (omit .Values.livenessProbe "enabled") "path") "context" $) | nindent 12 }} |
| 80 | + httpGet: |
| 81 | + path: {{ .Values.livenessProbe.path }} |
| 82 | + port: http |
| 83 | + {{- end }} |
| 84 | + {{- if .Values.customReadinessProbe }} |
| 85 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} |
| 86 | + {{- else if .Values.readinessProbe.enabled }} |
| 87 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit (omit .Values.readinessProbe "enabled") "path") "context" $) | nindent 12 }} |
| 88 | + httpGet: |
| 89 | + path: {{ .Values.readinessProbe.path }} |
| 90 | + port: http |
| 91 | + {{- end }} |
| 92 | + {{- if .Values.customStartupProbe }} |
| 93 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} |
| 94 | + {{- else if .Values.startupProbe.enabled }} |
| 95 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit (omit .Values.startupProbe "enabled") "path") "context" $) | nindent 12 }} |
| 96 | + httpGet: |
| 97 | + path: {{ .Values.startupProbe.path }} |
| 98 | + port: http |
| 99 | + {{- end }} |
| 100 | + {{- end }} |
| 101 | + {{- if .Values.resources }} |
| 102 | + resources: {{- toYaml .Values.resources | nindent 12 }} |
| 103 | + {{- end }} |
| 104 | + volumeMounts: |
| 105 | + - name: data |
| 106 | + mountPath: {{ .Values.persistence.mountPath | quote }} |
| 107 | + volumes: |
| 108 | +{{- if not .Values.persistence.enabled }} |
| 109 | + - name: data |
| 110 | + emptyDir: {} |
| 111 | +{{- end }} |
| 112 | +{{- if .Values.persistence.enabled }} |
| 113 | + volumeClaimTemplates: |
| 114 | + - metadata: |
| 115 | + name: data |
| 116 | + annotations: |
| 117 | + {{- if .Values.persistence.annotations }} |
| 118 | +{{ toYaml .Values.persistence.annotations | indent 8 }} |
| 119 | + {{- end }} |
| 120 | + labels: |
| 121 | + application: {{ template "cloudbeaver.fullname" . }} |
| 122 | + release: {{ .Release.Name }} |
| 123 | + heritage: {{ .Release.Service }} |
| 124 | + spec: |
| 125 | + accessModes: |
| 126 | +{{ toYaml .Values.persistence.accessModes | indent 8 }} |
| 127 | + resources: |
| 128 | + requests: |
| 129 | + storage: "{{ .Values.persistence.size }}" |
| 130 | + {{- if .Values.persistence.storageClass }} |
| 131 | + {{- if (eq "-" .Values.persistence.storageClass) }} |
| 132 | + storageClassName: "" |
| 133 | + {{- else }} |
| 134 | + storageClassName: "{{ .Values.persistence.storageClass }}" |
| 135 | + {{- end }} |
| 136 | + {{- end }} |
| 137 | + {{- end }} |
| 138 | + |
0 commit comments