Skip to content

Commit f576feb

Browse files
committed
enable helm templating in affinity section using tpl
1 parent c93ed8b commit f576feb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

charts/gateway/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ spec:
115115
{{- end }}
116116
{{- with .Values.affinity }}
117117
affinity:
118-
{{- toYaml . | nindent 8 }}
118+
{{- tpl (toYaml .) $ | nindent 8 }}
119119
{{- end }}
120120
{{- with .Values.tolerations }}
121121
tolerations:

tests/gateway/test-values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,14 @@ resources:
3434
requests:
3535
cpu: 250m
3636
memory: 256Mi
37+
38+
affinity:
39+
podAntiAffinity:
40+
requiredDuringSchedulingIgnoredDuringExecution:
41+
- labelSelector:
42+
matchExpressions:
43+
- key: app.kubernetes.io/instance
44+
operator: In
45+
values:
46+
- "{{ .Release.Name }}"
47+
topologyKey: "kubernetes.io/hostname"

0 commit comments

Comments
 (0)