Closed oburd closed 2 months ago
That's not currently possible. PRs are welcome though :slightly_smiling_face:
We could add deploy.affinity
to the values.yaml
and make it so the default value is what's currently specified in the template, e.g. values.yaml would look like:
deploy:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
clusterName: {{ include "infinispan-helm-charts.name" . }}
app: infinispan-pod
topologyKey: kubernetes.io/hostname
weight: 100
You mean it's me need to create PR ? About affinity, so i can add in values.yml ? Something like this affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution:
You mean it's me need to create PR ?
The feature may get added in the future by someone else (thanks for raising the issue), but submitting a PR yourself will definitely speed things up and ensure the feature is added.
About affinity, so i can add in values.yml ?
In order for us to support this there are two changes required:
values.yaml
included with the chart to include the yaml I posted. This is to ensure that the existing behaviour doesn't changes.templates/statefulset.yaml
template needs to be updated to remove the existing podAntiAffinity
and instead include .Values.deploy.affinity
. See how the spec.nodeSelector
value is configured in this template for a similar example.If i right understand in stateful.yml instead of this
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
clusterName: {{ include "infinispan-helm-charts.name" . }}
app: infinispan-pod
topologyKey: kubernetes.io/hostname
weight: 100
add this to statefulset template
{{- if .Values.deploy.affinity }}
affinity :
{{- with .Values.deploy.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
And need to add in value.yml:
affinity: {}
That looks correct :+1:
So should i do the PR ? for this ?
If you're able to, it would be much appreciated!
Hello! I will do little later
Hello! Can you create affinity template for deployment ? Because i don need hostname, i need zones Is this possible ? Thank you