Added nodeSelector for celery deployment and migrate job (#1085)

# What this PR does
Adds nodeSelector for celery deployment and migrate job

## Which issue(s) this PR fixes
Fixes errors while deploying resources in a cluster with Gatekeeper
policy ( that restricts deployments without nodeSelector).

## Checklist

- [x] Tests updated
- [x] Documentation added
- [x] `CHANGELOG.md` updated

---------

Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
This commit is contained in:
pikilisaikiran 2023-06-09 02:23:11 +05:30 committed by GitHub
parent c1935ef46c
commit a0da31f745
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -34,6 +34,10 @@ spec:
{{- if eq .Values.database.type "postgresql" }} {{- if eq .Values.database.type "postgresql" }}
{{- include "oncall.postgresql.wait-for-db" . | indent 8 }} {{- include "oncall.postgresql.wait-for-db" . | indent 8 }}
{{- end }} {{- end }}
{{- with .Values.celery.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
securityContext: securityContext:

View file

@ -35,6 +35,10 @@ spec:
serviceAccountName: {{ include "oncall.serviceAccountName" . }} serviceAccountName: {{ include "oncall.serviceAccountName" . }}
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.migrate.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }}-migrate - name: {{ .Chart.Name }}-migrate
securityContext: securityContext:

View file

@ -67,6 +67,9 @@ celery:
initialDelaySeconds: 30 initialDelaySeconds: 30
periodSeconds: 300 periodSeconds: 300
timeoutSeconds: 10 timeoutSeconds: 10
## Node labels for pod assignment
## ref: https://kubernetes.io/docs/user-guide/node-selection/
nodeSelector: {}
resources: {} resources: {}
# limits: # limits:
# cpu: 100m # cpu: 100m
@ -161,6 +164,9 @@ oncall:
# Whether to run django database migrations automatically # Whether to run django database migrations automatically
migrate: migrate:
enabled: true enabled: true
## Node labels for pod assignment
## ref: https://kubernetes.io/docs/user-guide/node-selection/
nodeSelector: {}
# TTL can be unset by setting ttlSecondsAfterFinished: "" # TTL can be unset by setting ttlSecondsAfterFinished: ""
ttlSecondsAfterFinished: 20 ttlSecondsAfterFinished: 20
# use a helm hook to manage the migration job # use a helm hook to manage the migration job