add podLabels to helm (#3167)
# What this PR does Add option to add additional pod labels. ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) - [x] It is manually tested in the internal environment --------- Co-authored-by: Marius Ensrud <marius.ensrud@skatteetaten.no> Co-authored-by: Joey Orlando <joey.orlando@grafana.com> Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com> Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
This commit is contained in:
parent
609da8044e
commit
719765a72d
5 changed files with 50 additions and 0 deletions
|
|
@ -18,6 +18,9 @@ spec:
|
|||
{{- end }}
|
||||
labels:
|
||||
{{- include "oncall.celery.selectorLabels" . | nindent 8 }}
|
||||
{{- if .Values.celery.podLabels }}
|
||||
{{- toYaml .Values.celery.podLabels | nindent 8}}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ spec:
|
|||
{{- end }}
|
||||
labels:
|
||||
{{- include "oncall.engine.selectorLabels" . | nindent 8 }}
|
||||
{{- if .Values.engine.podLabels }}
|
||||
{{- toYaml .Values.engine.podLabels | nindent 8}}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
{{- include "oncall.telegramPolling.selectorLabels" . | nindent 8 }}
|
||||
{{- if .Values.telegramPolling.podLabels }}
|
||||
{{- toYaml .Values.telegramPolling.podLabels | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
|
|
|
|||
32
helm/oncall/tests/podlabels_test.yaml
Normal file
32
helm/oncall/tests/podlabels_test.yaml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
suite: test podlabels for deployments
|
||||
templates:
|
||||
- celery/deployment.yaml
|
||||
- engine/deployment.yaml
|
||||
- telegram-polling/deployment.yaml
|
||||
release:
|
||||
name: oncall
|
||||
tests:
|
||||
- it: podLabels={} -> should exclude podLabels
|
||||
set:
|
||||
telegramPolling:
|
||||
enabled: true
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.metadata.labels.some-key
|
||||
|
||||
- it: podLabels -> should use custom podLabels
|
||||
set:
|
||||
engine:
|
||||
podLabels:
|
||||
some-key: some-value
|
||||
celery:
|
||||
podLabels:
|
||||
some-key: some-value
|
||||
telegramPolling:
|
||||
enabled: true
|
||||
podLabels:
|
||||
some-key: some-value
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.metadata.labels.some-key
|
||||
value: some-value
|
||||
|
|
@ -39,6 +39,9 @@ engine:
|
|||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
# Labels for engine pods
|
||||
podLabels: {}
|
||||
|
||||
## Deployment update strategy
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
|
||||
updateStrategy:
|
||||
|
|
@ -198,6 +201,9 @@ celery:
|
|||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
# Labels for celery pods
|
||||
podLabels: {}
|
||||
|
||||
## Affinity for pod assignment
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
affinity: {}
|
||||
|
|
@ -257,6 +263,9 @@ telegramPolling:
|
|||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
# Labels for telegram-polling pods
|
||||
podLabels: {}
|
||||
|
||||
# Extra volume mounts for the main container
|
||||
extraVolumeMounts: []
|
||||
# - name: postgres-tls
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue