|
| 1 | +{{- $envVars := include "impress.common.env" (list . .Values.backend) -}} |
| 2 | +{{- $fullName := include "impress.celery.worker.fullname" . -}} |
| 3 | +{{- $component := "celery-worker" -}} |
| 4 | +apiVersion: apps/v1 |
| 5 | +kind: Deployment |
| 6 | +metadata: |
| 7 | + name: {{ $fullName }} |
| 8 | + namespace: {{ .Release.Namespace | quote }} |
| 9 | + annotations: |
| 10 | + {{- with .Values.backend.dpAnnotations }} |
| 11 | + {{- toYaml . | nindent 4 }} |
| 12 | + {{- end }} |
| 13 | + labels: |
| 14 | + {{- include "impress.common.labels" (list . $component) | nindent 4 }} |
| 15 | +spec: |
| 16 | + replicas: {{ .Values.backend.celery.replicas }} |
| 17 | + selector: |
| 18 | + matchLabels: |
| 19 | + {{- include "impress.common.selectorLabels" (list . $component) | nindent 6 }} |
| 20 | + template: |
| 21 | + metadata: |
| 22 | + annotations: |
| 23 | + {{- with .Values.backend.podAnnotations }} |
| 24 | + {{- toYaml . | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + labels: |
| 27 | + {{- include "impress.common.selectorLabels" (list . $component) | nindent 8 }} |
| 28 | + spec: |
| 29 | + {{- if $.Values.image.credentials }} |
| 30 | + imagePullSecrets: |
| 31 | + - name: {{ include "impress.secret.dockerconfigjson.name" (dict "fullname" (include "impress.fullname" .) "imageCredentials" $.Values.image.credentials) }} |
| 32 | + {{- end}} |
| 33 | + shareProcessNamespace: {{ .Values.backend.shareProcessNamespace }} |
| 34 | + containers: |
| 35 | + {{- with .Values.backend.sidecars }} |
| 36 | + {{- toYaml . | nindent 8 }} |
| 37 | + {{- end }} |
| 38 | + - name: {{ .Chart.Name }} |
| 39 | + image: "{{ (.Values.backend.image | default dict).repository | default .Values.image.repository }}:{{ (.Values.backend.image | default dict).tag | default .Values.image.tag }}" |
| 40 | + imagePullPolicy: {{ (.Values.backend.image | default dict).pullPolicy | default .Values.image.pullPolicy }} |
| 41 | + {{- with .Values.backend.celery.command }} |
| 42 | + command: |
| 43 | + {{- toYaml . | nindent 12 }} |
| 44 | + {{- end }} |
| 45 | + {{- with .Values.backend.celery.args }} |
| 46 | + args: |
| 47 | + {{- toYaml . | nindent 12 }} |
| 48 | + {{- end }} |
| 49 | + env: |
| 50 | + {{- if $envVars}} |
| 51 | + {{- $envVars | indent 12 }} |
| 52 | + {{- end }} |
| 53 | + {{- with .Values.backend.securityContext }} |
| 54 | + securityContext: |
| 55 | + {{- toYaml . | nindent 12 }} |
| 56 | + {{- end }} |
| 57 | + ports: |
| 58 | + - name: http |
| 59 | + containerPort: {{ .Values.backend.service.targetPort }} |
| 60 | + protocol: TCP |
| 61 | + {{- if .Values.backend.celery.probes.liveness }} |
| 62 | + livenessProbe: |
| 63 | + {{- include "impress.probes.abstract" (merge .Values.backend.celery.probes.liveness (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }} |
| 64 | + {{- end }} |
| 65 | + {{- if .Values.backend.celery.probes.readiness }} |
| 66 | + readinessProbe: |
| 67 | + {{- include "impress.probes.abstract" (merge .Values.backend.celery.probes.readiness (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }} |
| 68 | + {{- end }} |
| 69 | + {{- if .Values.backend.celery.probes.startup }} |
| 70 | + startupProbe: |
| 71 | + {{- include "impress.probes.abstract" (merge .Values.backend.celery.probes.startup (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }} |
| 72 | + {{- end }} |
| 73 | + {{- with .Values.backend.resources }} |
| 74 | + resources: |
| 75 | + {{- toYaml . | nindent 12 }} |
| 76 | + {{- end }} |
| 77 | + volumeMounts: |
| 78 | + {{- range $index, $value := .Values.mountFiles }} |
| 79 | + - name: "files-{{ $index }}" |
| 80 | + mountPath: {{ $value.path }} |
| 81 | + subPath: content |
| 82 | + {{- end }} |
| 83 | + {{- range $name, $volume := .Values.backend.persistence }} |
| 84 | + - name: "{{ $name }}" |
| 85 | + mountPath: "{{ $volume.mountPath }}" |
| 86 | + {{- end }} |
| 87 | + {{- range .Values.backend.extraVolumeMounts }} |
| 88 | + - name: {{ .name }} |
| 89 | + mountPath: {{ .mountPath }} |
| 90 | + subPath: {{ .subPath | default "" }} |
| 91 | + readOnly: {{ .readOnly }} |
| 92 | + {{- end }} |
| 93 | + {{- if .Values.backend.themeCustomization.enabled }} |
| 94 | + - name: theme-customization |
| 95 | + mountPath: {{ .Values.backend.themeCustomization.mount_path }} |
| 96 | + readOnly: true |
| 97 | + {{- end }} |
| 98 | + {{- with .Values.backend.nodeSelector }} |
| 99 | + nodeSelector: |
| 100 | + {{- toYaml . | nindent 8 }} |
| 101 | + {{- end }} |
| 102 | + {{- with .Values.backend.affinity }} |
| 103 | + affinity: |
| 104 | + {{- toYaml . | nindent 8 }} |
| 105 | + {{- end }} |
| 106 | + {{- with .Values.backend.tolerations }} |
| 107 | + tolerations: |
| 108 | + {{- toYaml . | nindent 8 }} |
| 109 | + {{- end }} |
| 110 | + volumes: |
| 111 | + {{- range $index, $value := .Values.mountFiles }} |
| 112 | + - name: "files-{{ $index }}" |
| 113 | + configMap: |
| 114 | + name: "{{ include "impress.fullname" $ }}-files-{{ $index }}" |
| 115 | + {{- end }} |
| 116 | + {{- range $name, $volume := .Values.backend.persistence }} |
| 117 | + - name: "{{ $name }}" |
| 118 | + {{- if eq $volume.type "emptyDir" }} |
| 119 | + emptyDir: {} |
| 120 | + {{- else }} |
| 121 | + persistentVolumeClaim: |
| 122 | + claimName: "{{ $fullName }}-{{ $name }}" |
| 123 | + {{- end }} |
| 124 | + {{- end }} |
| 125 | + {{- if .Values.backend.themeCustomization.enabled }} |
| 126 | + - name: theme-customization |
| 127 | + configMap: |
| 128 | + name: docs-theme-customization |
| 129 | + {{- end }} |
| 130 | + {{- range .Values.backend.extraVolumes }} |
| 131 | + - name: {{ .name }} |
| 132 | + {{- if .existingClaim }} |
| 133 | + persistentVolumeClaim: |
| 134 | + claimName: {{ .existingClaim }} |
| 135 | + {{- else if .hostPath }} |
| 136 | + hostPath: |
| 137 | + {{ toYaml .hostPath | nindent 12 }} |
| 138 | + {{- else if .csi }} |
| 139 | + csi: |
| 140 | + {{- toYaml .csi | nindent 12 }} |
| 141 | + {{- else if .configMap }} |
| 142 | + configMap: |
| 143 | + {{- toYaml .configMap | nindent 12 }} |
| 144 | + {{- else if .emptyDir }} |
| 145 | + emptyDir: |
| 146 | + {{- toYaml .emptyDir | nindent 12 }} |
| 147 | + {{- else }} |
| 148 | + emptyDir: {} |
| 149 | + {{- end }} |
| 150 | + {{- end }} |
0 commit comments