diff --git a/README.md b/README.md index 9945aa6..7337547 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Configure your Infinispan cluster by specifying values in the `deploy.*` section | `deploy.nodeSelector` | Defines the nodeSelector policy used by the cluster's StatefulSet | `{}` | - | | `deploy.nodeAffinity` | Defines the nodeAffinity policy used by the cluster's StatefulSet | `{}` | - | | `deploy.podAffinity` | Defines the podAffinity policy used by the cluster's StatefulSet | `{}` | - | -| `deploy.podAntiAffinity` | Defines the podAntiAffinity policy used by the cluster's StatefulSet |
podAntiAffinity:  
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
clusterName: "{{ tpl include \"infinispan-helm-charts.name\" . }}"
app: infinispan-pod
topologyKey: kubernetes.io/hostname
weight: 100
| - | +| `deploy.podAntiAffinity` | Defines the podAntiAffinity policy used by the cluster's StatefulSet |
podAntiAffinity: >
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
clusterName: {{ include "infinispan-helm-charts.name" . }}
app: infinispan-pod
topologyKey: kubernetes.io/hostname
weight: 100
| - | | `deploy.makeDataDirWritable` | Allows write access to the `data` directory for each Infinispan Server node. | false | Setting the value to `true` creates an initContainer that runs `chmod -R` on the `/opt/infinispan/server/data` directory and changes its permissions. | | `deploy.monitoring.enabled` | Enable or disable `ServiceMonitor` functionality. | false | Users must have `monitoring-edit` role assigned by the admin to deploy the Helm chart with `ServiceMonitor` enabled. | | `deploy.nameOverride` | Specifies a name for all Infinispan cluster resources. | Helm Chart release name | Configure a name for the created resources only if you need it to be different to the Helm Chart release name. | diff --git a/README.md.tpl b/README.md.tpl index 352d7ec..d06f51c 100644 --- a/README.md.tpl +++ b/README.md.tpl @@ -45,7 +45,7 @@ Configure your {brandname} cluster by specifying values in the `deploy.*` sectio | `deploy.nodeSelector` | Defines the nodeSelector policy used by the cluster's StatefulSet | `{}` | - | | `deploy.nodeAffinity` | Defines the nodeAffinity policy used by the cluster's StatefulSet | `{}` | - | | `deploy.podAffinity` | Defines the podAffinity policy used by the cluster's StatefulSet | `{}` | - | -| `deploy.podAntiAffinity` | Defines the podAntiAffinity policy used by the cluster's StatefulSet |
podAntiAffinity:  
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
clusterName: "{{ tpl include \"infinispan-helm-charts.name\" . }}"
app: infinispan-pod
topologyKey: kubernetes.io/hostname
weight: 100
| - | +| `deploy.podAntiAffinity` | Defines the podAntiAffinity policy used by the cluster's StatefulSet |
podAntiAffinity: >
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
clusterName: {{ include "infinispan-helm-charts.name" . }}
app: infinispan-pod
topologyKey: kubernetes.io/hostname
weight: 100
| - | | `deploy.makeDataDirWritable` | Allows write access to the `data` directory for each {brandname} Server node. | false | Setting the value to `true` creates an initContainer that runs `chmod -R` on the `/opt/infinispan/server/data` directory and changes its permissions. | | `deploy.monitoring.enabled` | Enable or disable `ServiceMonitor` functionality. | false | Users must have `monitoring-edit` role assigned by the admin to deploy the Helm chart with `ServiceMonitor` enabled. | | `deploy.nameOverride` | Specifies a name for all {brandname} cluster resources. | Helm Chart release name | Configure a name for the created resources only if you need it to be different to the Helm Chart release name. | diff --git a/documentation/asciidoc/topics/ref_deployment_configuration_values.adoc b/documentation/asciidoc/topics/ref_deployment_configuration_values.adoc index 0acf985..032e3e5 100644 --- a/documentation/asciidoc/topics/ref_deployment_configuration_values.adoc +++ b/documentation/asciidoc/topics/ref_deployment_configuration_values.adoc @@ -134,7 +134,7 @@ a|[source, yaml] - podAffinityTerm: labelSelector: matchLabels: - clusterName: "{{ tpl include \"infinispan-helm-charts.name\" . }}" + clusterName: {{ tpl include "infinispan-helm-charts.name" . }} app: infinispan-pod topologyKey: kubernetes.io/hostname weight: 100 diff --git a/templates/statefulset.yaml b/templates/statefulset.yaml index fb19b9b..20b49cb 100644 --- a/templates/statefulset.yaml +++ b/templates/statefulset.yaml @@ -49,9 +49,11 @@ spec: {{- end }} {{- if .Values.deploy.podAntiAffinity }} podAntiAffinity: - {{- with .Values.deploy.podAntiAffinity }} - {{- toYaml . | nindent 10 }} - {{- end }} + {{- if typeIs "string" .Values.deploy.podAntiAffinity }} + {{- tpl .Values.deploy.podAntiAffinity . | nindent 10 }} + {{- else }} + {{- toYaml .Values.deploy.podAntiAffinity | nindent 10 }} + {{- end }} {{- end }} {{- if .Values.deploy.nodeAffinity }} nodeAffinity: diff --git a/values.yaml b/values.yaml index 4b079ea..e2368eb 100644 --- a/values.yaml +++ b/values.yaml @@ -1,7 +1,6 @@ # Default values for infinispan-helm-charts. # This is a YAML-formatted file. # Declare variables to be passed into your templates. - images: # [USER] The container images for server pods. server: quay.io/infinispan/server:15.0 @@ -88,12 +87,15 @@ deploy: podAffinity: {} - podAntiAffinity: + # PodAntiAffinity is expressed as a string (note the > char) + # to allow dynamic replacing of clusterName in statefulSet + # chart also supports plain yaml value if dynamic replacement is not needed + podAntiAffinity: > preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchLabels: - clusterName: "{{ tpl include \"infinispan-helm-charts.name\" . }}" + clusterName: {{ include "infinispan-helm-charts.name" . }} app: infinispan-pod topologyKey: kubernetes.io/hostname weight: 100