|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "pontoon.fullname" . }} |
| 5 | + labels: |
| 6 | + app: {{ include "pontoon.fullname" . }} |
| 7 | + chart: {{ .Chart.Name }}-{{ .Chart.Version }} |
| 8 | + heritage: {{ .Release.Service }} |
| 9 | + release: {{ .Release.Name }} |
| 10 | + component: "pontoon" |
| 11 | +spec: |
| 12 | +{{- if not .Values.autoscaling.enabled }} |
| 13 | + replicas: {{ .Values.replicaCount }} |
| 14 | +{{- end }} |
| 15 | + selector: |
| 16 | + matchLabels: |
| 17 | + app: {{ include "pontoon.fullname" . }} |
| 18 | + heritage: {{ .Release.Service }} |
| 19 | + release: {{ .Release.Name }} |
| 20 | + component: "pontoon" |
| 21 | + template: |
| 22 | + metadata: |
| 23 | + annotations: |
| 24 | + checksum/pontoon-secrets: {{ include (print $.Template.BasePath "/pontoon-secrets.yaml") . | sha256sum }} |
| 25 | + checksum/pontoon-ssh-secrets: {{ include (print $.Template.BasePath "/pontoon-ssh-secrets.yaml") . | sha256sum }} |
| 26 | + checksum/pontoon-settings: {{ include (print $.Template.BasePath "/pontoon-settings-configmap.yaml") . | sha256sum }} |
| 27 | + {{- range $key, $value := .Values.podAnnotations }} |
| 28 | + {{ $key }}: {{ $value | quote }} |
| 29 | + {{- end }} |
| 30 | + labels: |
| 31 | + app: {{ include "pontoon.fullname" . }} |
| 32 | + chart: {{ .Chart.Name }}-{{ .Chart.Version }} |
| 33 | + heritage: {{ .Release.Service }} |
| 34 | + release: {{ .Release.Name }} |
| 35 | + component: "pontoon" |
| 36 | + spec: |
| 37 | + imagePullSecrets: |
| 38 | + {{- range .Values.imagePullSecrets }} |
| 39 | + - name: {{ .name | quote }} |
| 40 | + {{- end }} |
| 41 | + serviceAccountName: {{ include "pontoon.serviceAccountName" . }} |
| 42 | + securityContext: |
| 43 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 44 | + {{- if or .Values.ssh.config .Values.ssh.privateKeys }} |
| 45 | + initContainers: |
| 46 | + - name: copy-ssh-secrets |
| 47 | + image: "busybox" |
| 48 | + command: |
| 49 | + - "cp" |
| 50 | + - "-r" |
| 51 | + - "/ssh-data/." |
| 52 | + - {{ .Values.ssh.mountPath | quote }} |
| 53 | + volumeMounts: |
| 54 | + - mountPath: {{ .Values.ssh.mountPath | quote }} |
| 55 | + name: "dummy-volume" |
| 56 | + - mountPath: "/ssh-data" |
| 57 | + name: "pontoon-ssh" |
| 58 | + {{- end }} |
| 59 | + containers: |
| 60 | + - name: pontoon |
| 61 | + securityContext: |
| 62 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 63 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 64 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 65 | + ports: |
| 66 | + - name: http |
| 67 | + containerPort: 8000 |
| 68 | + protocol: TCP |
| 69 | + command: ["gunicorn"] |
| 70 | + args: |
| 71 | + - "pontoon.wsgi:application" |
| 72 | + - "--bind=0.0.0.0" |
| 73 | + # TODO - add livenessProbe and readinessProbe |
| 74 | + # Pontoon does not seem to have a health check endpoint... |
| 75 | + # Maybe consider adding one to upstream |
| 76 | + resources: |
| 77 | + {{- toYaml .Values.resources | nindent 12 }} |
| 78 | + envFrom: |
| 79 | + - secretRef: |
| 80 | + name: "{{ include "pontoon.fullname" . }}-secrets" |
| 81 | + env: |
| 82 | + - name: SITE_URL |
| 83 | + value: {{ .Values.siteUrl | quote }} |
| 84 | + {{- include "common.tplvalues.render" (dict "value" .Values.defaultEnvVars "context" $) | nindent 12 }} |
| 85 | + {{- if .Values.extraSettingsModule }} |
| 86 | + - name: DJANGO_SETTINGS_MODULE |
| 87 | + value: "pontoon.settings.custom" |
| 88 | + {{- end }} |
| 89 | + {{- if .Values.extraEnvVars }} |
| 90 | + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} |
| 91 | + {{- end }} |
| 92 | + volumeMounts: |
| 93 | + {{- if .Values.extraSettingsModule }} |
| 94 | + - mountPath: "{{ .Values.pontoonHome }}/pontoon/settings/custom.py" |
| 95 | + name: "pontoon-settings" |
| 96 | + subPath: "custom.py" |
| 97 | + {{- end }} |
| 98 | + {{- if or .Values.ssh.config .Values.ssh.privateKeys }} |
| 99 | + - name: "dummy-volume" |
| 100 | + mountPath: {{ .Values.ssh.mountPath | quote }} |
| 101 | + {{- end }} |
| 102 | + volumes: |
| 103 | + {{- if .Values.extraSettingsModule }} |
| 104 | + - name: "pontoon-settings" |
| 105 | + configMap: |
| 106 | + name: "{{ include "pontoon.fullname" . }}-settings-configmap" |
| 107 | + {{- end }} |
| 108 | + {{- if or .Values.ssh.config .Values.ssh.privateKeys }} |
| 109 | + - name: "pontoon-ssh" |
| 110 | + secret: |
| 111 | + secretName: "{{ include "pontoon.fullname" . }}-ssh-secrets" |
| 112 | + defaultMode: 420 # 0644 |
| 113 | + - name: "dummy-volume" |
| 114 | + emptyDir: {} |
| 115 | + {{- end }} |
| 116 | + {{- with .Values.nodeSelector }} |
| 117 | + nodeSelector: |
| 118 | + {{- toYaml . | nindent 8 }} |
| 119 | + {{- end }} |
| 120 | + {{- with .Values.affinity }} |
| 121 | + affinity: |
| 122 | + {{- toYaml . | nindent 8 }} |
| 123 | + {{- end }} |
| 124 | + {{- with .Values.tolerations }} |
| 125 | + tolerations: |
| 126 | + {{- toYaml . | nindent 8 }} |
| 127 | + {{- end }} |
0 commit comments