fix(deployment): template affinity
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing

This commit is contained in:
Markus Pesch 2024-12-06 23:57:09 +01:00
parent 1581617daf
commit ce4065bda8
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
2 changed files with 32 additions and 0 deletions

View File

@ -21,6 +21,10 @@ spec:
labels:
{{- include "prometheus-postgres-exporter.pod.labels" . | nindent 8 }}
spec:
{{- with .Values.deployment.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: postgres-exporter
args:

View File

@ -30,6 +30,8 @@ tests:
- equal:
path: spec.replicas
value: 1
- notExists:
path: spec.template.spec.affinity
- contains:
path: spec.template.spec.containers[0].envFrom
content:
@ -102,6 +104,32 @@ tests:
path: spec.replicas
value: 3
- it: Test custom affinity
set:
deployment.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- antarctica-east1
- antarctica-west1
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- antarctica-east1
- antarctica-west1
- it: Test additional arguments
set:
deployment.postgresExporter.args: