apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-deployment labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment spec: replicas: {{ include "gotenberg.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.gotenberg.replicas) }} selector: matchLabels: app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment template: metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-deployment labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment spec: automountServiceAccountToken: false securityContext: {{- toYaml .Values.gotenberg.securityContext.pod | nindent 8 }} containers: - name: {{ .Release.Name }}-{{ .Chart.Name }}-deployment image: "gotenberg/gotenberg:{{ .Chart.AppVersion }}" imagePullPolicy: IfNotPresent {{- if .Values.gotenberg.env }} env: {{- range $value := .Values.gotenberg.env }} {{- if $value.value }} - name: {{ $value.name | quote }} value: {{ tpl $value.value $ | quote }} {{- else if $value.valueFrom }} {{- if $value.valueFrom.secretKeyRef }} - name: {{ $value.name }} valueFrom: secretKeyRef: name: {{ tpl $value.valueFrom.secretKeyRef.name $ | quote }} key: {{ tpl $value.valueFrom.secretKeyRef.key $ | quote }} {{- else if $value.valueFrom.configMapKeyRef }} - name: {{ $value.name }} valueFrom: configMapKeyRef: name: {{ tpl $value.valueFrom.configMapKeyRef.name $ | quote }} key: {{ tpl $value.valueFrom.configMapKeyRef.key $ | quote }} {{- end }} {{- end }} {{- end }} {{- end }} securityContext: {{- toYaml .Values.gotenberg.securityContext.container | nindent 12 }} volumeMounts: # Gotenberg (and the Chromium/LibreOffice it drives) needs writable # /tmp and home directories; with a read-only root filesystem these # are provided as emptyDirs. - name: tmp mountPath: /tmp - name: gotenberg-home mountPath: /home/gotenberg ports: - containerPort: 3000 protocol: TCP name: gotenberg-port livenessProbe: {{- toYaml .Values.gotenberg.livenessProbe | nindent 12 }} readinessProbe: {{- toYaml .Values.gotenberg.readinessProbe | nindent 12 }} startupProbe: {{- toYaml .Values.gotenberg.startupProbe | nindent 12 }} resources: {{- include "gotenberg.resources" .Values.gotenberg.resources | nindent 12 }} volumes: - name: tmp emptyDir: {} - name: gotenberg-home emptyDir: {} restartPolicy: Always