helm-charts
helm-charts copied to clipboard
Enable Helm Template for the Pod affinity
Details
Describe the solution you'd like:
Allow to use Helm Template for fields in the affinity
block (e.g. defaultPodOptions.affinity
).
Additional Information:
I like to set the podAntiAffinity
on the hostname
to avoid having two Pods of the same application running on the same hosts. Generally, I configure it like so:
[....]
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- "my-app"
topologyKey: kubernetes.io/hostname
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- "my-app"
topologyKey: region
[....]
Enabling Helm Template for the affinity
block would allow me to make this re-usable for all my applications, changing my-app
by {{ Release.Name }}