Skip to content

Commit

Permalink
feat(pontoon): customize config for worker&cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellzc committed Dec 20, 2020
1 parent a6812f8 commit 379ec2b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/pontoon/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: pontoon
home: https://github.com/mozilla/pontoon
version: 1.1.1
version: 1.2.0
# Pontoon no longer cuts releases.
# See https://github.com/mozilla/pontoon/releases/tag/2018-12-19
# and https://hub.docker.com/r/skillsnetwork/pontoon/tags
Expand Down
14 changes: 9 additions & 5 deletions charts/pontoon/templates/pontoon-sync-projects-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ spec:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
component: "pontoon-sync-projects-cronjob"
annotations:
{{- range $key, $value := .Values.syncProjectCronjob.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
template:
spec:
Expand All @@ -30,7 +34,7 @@ spec:
{{- end }}
serviceAccountName: {{ include "pontoon.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
{{- toYaml .Values.syncProjectCronjob.podSecurityContext | nindent 12 }}
restartPolicy: OnFailure
{{- if or .Values.ssh.config .Values.ssh.privateKeys }}
initContainers:
Expand All @@ -50,7 +54,7 @@ spec:
containers:
- name: sync-projects
securityContext:
{{- toYaml .Values.securityContext | nindent 16 }}
{{- toYaml .Values.syncProjectCronjob.securityContext | nindent 16 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["python"]
Expand Down Expand Up @@ -99,15 +103,15 @@ spec:
- name: "dummy-volume"
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.syncProjectCronjob.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.syncProjectCronjob.affinity }}
affinity:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.syncProjectCronjob.tolerations }}
tolerations:
{{- toYaml . | nindent 12 }}
{{- end }}
16 changes: 8 additions & 8 deletions charts/pontoon/templates/pontoon-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ spec:
checksum/pontoon-secrets: {{ include (print $.Template.BasePath "/pontoon-secrets.yaml") . | sha256sum }}
checksum/pontoon-ssh-secrets: {{ include (print $.Template.BasePath "/pontoon-ssh-secrets.yaml") . | sha256sum }}
checksum/pontoon-settings: {{ include (print $.Template.BasePath "/pontoon-settings-configmap.yaml") . | sha256sum }}
{{- range $key, $value := .Values.podAnnotations }}
{{- range $key, $value := .Values.worker.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app: {{ include "pontoon.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
Expand All @@ -41,7 +41,7 @@ spec:
{{- end }}
serviceAccountName: {{ include "pontoon.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.worker.podSecurityContext | nindent 8 }}
{{- if or .Values.ssh.config .Values.ssh.privateKeys }}
initContainers:
- name: copy-ssh-secrets
Expand All @@ -60,13 +60,13 @@ spec:
containers:
- name: pontoon-worker
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.worker.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["celery"]
args: {{- toYaml .Values.worker.celeryArgs | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml .Values.worker.resources | nindent 12 }}
envFrom:
- secretRef:
name: "{{ include "pontoon.fullname" . }}-secrets"
Expand Down Expand Up @@ -107,15 +107,15 @@ spec:
- name: "dummy-volume"
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.worker.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.worker.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.worker.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
13 changes: 13 additions & 0 deletions charts/pontoon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ worker:
- "--without-gossip"
- "--without-mingle"
- "--without-heartbeat"
podAnnotations: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
podSecurityContext: {}
securityContext: {}
autoscaling:
enabled: false
minReplicas: 1
Expand All @@ -81,7 +88,13 @@ syncProjectCronjob:
suspend: false
successfulJobsHistoryLimit: 10
failedJobsHistoryLimit: 10
podAnnotations: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
podSecurityContext: {}
securityContext: {}

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

0 comments on commit 379ec2b

Please sign in to comment.