Skip to content

Commit 379ec2b

Browse files
committed
feat(pontoon): customize config for worker&cronjob
1 parent a6812f8 commit 379ec2b

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed

charts/pontoon/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: pontoon
33
home: https://github.com/mozilla/pontoon
4-
version: 1.1.1
4+
version: 1.2.0
55
# Pontoon no longer cuts releases.
66
# See https://github.com/mozilla/pontoon/releases/tag/2018-12-19
77
# and https://hub.docker.com/r/skillsnetwork/pontoon/tags

charts/pontoon/templates/pontoon-sync-projects-cronjob.yaml

+9-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ spec:
2121
heritage: {{ .Release.Service }}
2222
release: {{ .Release.Name }}
2323
component: "pontoon-sync-projects-cronjob"
24+
annotations:
25+
{{- range $key, $value := .Values.syncProjectCronjob.podAnnotations }}
26+
{{ $key }}: {{ $value | quote }}
27+
{{- end }}
2428
spec:
2529
template:
2630
spec:
@@ -30,7 +34,7 @@ spec:
3034
{{- end }}
3135
serviceAccountName: {{ include "pontoon.serviceAccountName" . }}
3236
securityContext:
33-
{{- toYaml .Values.podSecurityContext | nindent 12 }}
37+
{{- toYaml .Values.syncProjectCronjob.podSecurityContext | nindent 12 }}
3438
restartPolicy: OnFailure
3539
{{- if or .Values.ssh.config .Values.ssh.privateKeys }}
3640
initContainers:
@@ -50,7 +54,7 @@ spec:
5054
containers:
5155
- name: sync-projects
5256
securityContext:
53-
{{- toYaml .Values.securityContext | nindent 16 }}
57+
{{- toYaml .Values.syncProjectCronjob.securityContext | nindent 16 }}
5458
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
5559
imagePullPolicy: {{ .Values.image.pullPolicy }}
5660
command: ["python"]
@@ -99,15 +103,15 @@ spec:
99103
- name: "dummy-volume"
100104
emptyDir: {}
101105
{{- end }}
102-
{{- with .Values.nodeSelector }}
106+
{{- with .Values.syncProjectCronjob.nodeSelector }}
103107
nodeSelector:
104108
{{- toYaml . | nindent 12 }}
105109
{{- end }}
106-
{{- with .Values.affinity }}
110+
{{- with .Values.syncProjectCronjob.affinity }}
107111
affinity:
108112
{{- toYaml . | nindent 12 }}
109113
{{- end }}
110-
{{- with .Values.tolerations }}
114+
{{- with .Values.syncProjectCronjob.tolerations }}
111115
tolerations:
112116
{{- toYaml . | nindent 12 }}
113117
{{- end }}

charts/pontoon/templates/pontoon-worker-deployment.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ spec:
2525
checksum/pontoon-secrets: {{ include (print $.Template.BasePath "/pontoon-secrets.yaml") . | sha256sum }}
2626
checksum/pontoon-ssh-secrets: {{ include (print $.Template.BasePath "/pontoon-ssh-secrets.yaml") . | sha256sum }}
2727
checksum/pontoon-settings: {{ include (print $.Template.BasePath "/pontoon-settings-configmap.yaml") . | sha256sum }}
28-
{{- range $key, $value := .Values.podAnnotations }}
28+
{{- range $key, $value := .Values.worker.podAnnotations }}
2929
{{ $key }}: {{ $value | quote }}
30-
{{- end }}
30+
{{- end }}
3131
labels:
3232
app: {{ include "pontoon.fullname" . }}
3333
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
@@ -41,7 +41,7 @@ spec:
4141
{{- end }}
4242
serviceAccountName: {{ include "pontoon.serviceAccountName" . }}
4343
securityContext:
44-
{{- toYaml .Values.podSecurityContext | nindent 8 }}
44+
{{- toYaml .Values.worker.podSecurityContext | nindent 8 }}
4545
{{- if or .Values.ssh.config .Values.ssh.privateKeys }}
4646
initContainers:
4747
- name: copy-ssh-secrets
@@ -60,13 +60,13 @@ spec:
6060
containers:
6161
- name: pontoon-worker
6262
securityContext:
63-
{{- toYaml .Values.securityContext | nindent 12 }}
63+
{{- toYaml .Values.worker.securityContext | nindent 12 }}
6464
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
6565
imagePullPolicy: {{ .Values.image.pullPolicy }}
6666
command: ["celery"]
6767
args: {{- toYaml .Values.worker.celeryArgs | nindent 12 }}
6868
resources:
69-
{{- toYaml .Values.resources | nindent 12 }}
69+
{{- toYaml .Values.worker.resources | nindent 12 }}
7070
envFrom:
7171
- secretRef:
7272
name: "{{ include "pontoon.fullname" . }}-secrets"
@@ -107,15 +107,15 @@ spec:
107107
- name: "dummy-volume"
108108
emptyDir: {}
109109
{{- end }}
110-
{{- with .Values.nodeSelector }}
110+
{{- with .Values.worker.nodeSelector }}
111111
nodeSelector:
112112
{{- toYaml . | nindent 8 }}
113113
{{- end }}
114-
{{- with .Values.affinity }}
114+
{{- with .Values.worker.affinity }}
115115
affinity:
116116
{{- toYaml . | nindent 8 }}
117117
{{- end }}
118-
{{- with .Values.tolerations }}
118+
{{- with .Values.worker.tolerations }}
119119
tolerations:
120120
{{- toYaml . | nindent 8 }}
121121
{{- end }}

charts/pontoon/values.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ worker:
6868
- "--without-gossip"
6969
- "--without-mingle"
7070
- "--without-heartbeat"
71+
podAnnotations: {}
72+
resources: {}
73+
nodeSelector: {}
74+
tolerations: []
75+
affinity: {}
76+
podSecurityContext: {}
77+
securityContext: {}
7178
autoscaling:
7279
enabled: false
7380
minReplicas: 1
@@ -81,7 +88,13 @@ syncProjectCronjob:
8188
suspend: false
8289
successfulJobsHistoryLimit: 10
8390
failedJobsHistoryLimit: 10
91+
podAnnotations: {}
8492
resources: {}
93+
nodeSelector: {}
94+
tolerations: []
95+
affinity: {}
96+
podSecurityContext: {}
97+
securityContext: {}
8598

8699
# Configuration values for the postgres dependency
87100
# ref: https://github.com/bitnami/charts/blob/master/bitnami/postgresql/README.md

0 commit comments

Comments
 (0)