diff --git a/charts/gateway/templates/deployment.yaml b/charts/gateway/templates/deployment.yaml index 929bfee3..6ed27b8d 100644 --- a/charts/gateway/templates/deployment.yaml +++ b/charts/gateway/templates/deployment.yaml @@ -115,7 +115,7 @@ spec: {{- end }} {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} + {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: diff --git a/tests/gateway/test-values.yaml b/tests/gateway/test-values.yaml index d05466d0..c0de6e8d 100644 --- a/tests/gateway/test-values.yaml +++ b/tests/gateway/test-values.yaml @@ -34,3 +34,14 @@ resources: requests: cpu: 250m memory: 256Mi + +affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/instance + operator: In + values: + - "{{ .Release.Name }}" + topologyKey: "kubernetes.io/hostname"