diff --git a/CHANGELOG.md b/CHANGELOG.md index 96c5798..6fdce45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ chronology things are added/fixed/changed and - where possible - links to the PR ### Changes +[v0.8.2] +* added solr.enforceZoneAntiAffinity + [v0.8.0] * **Potentially breaking change**: changed `alfresco-ingress` definition & default values to enable usage of `ingressClassName` property in favour of `kubernetes.io/ingress.class` annotation. diff --git a/README.md b/README.md index 20ec6b4..8fec72b 100644 --- a/README.md +++ b/README.md @@ -1330,6 +1330,16 @@ nginx rules to redirect the normal pages to a 503 maintenance page. ``` * Description: With this list of parameters you can add 1 or multiple annotations to the Solr service +#### `solr.enforceZoneAntiAffinity` + +* Required: false +* Default: false +* Description: If true, this option enforces a pod anti-affinity on the Solr pods based on the zones. + I.e. if true, each Solr pod will require a unique zone. Starting more pods than zones will put the + remainder pods in a `Pending` state. +
+ Please note that switching off the anti-affinity does not alter the anti-affinity of the already running pods! + #### `solr.serviceAccount` * Required: false diff --git a/xenit-alfresco/templates/solr/solr-stateful-set.yaml b/xenit-alfresco/templates/solr/solr-stateful-set.yaml index bdfe112..8041901 100644 --- a/xenit-alfresco/templates/solr/solr-stateful-set.yaml +++ b/xenit-alfresco/templates/solr/solr-stateful-set.yaml @@ -30,6 +30,18 @@ spec: {{ toYaml .Values.solr.podAnnotations | nindent 8 }} {{- end }} spec: + {{- if .Values.solr.enforceZoneAntiAffinity }} + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - topologyKey: "topology.kubernetes.io/zone" + labelSelector: + matchExpressions: + - key: "app" + operator: "In" + values: + - solr + {{- end }} {{- if .Values.solr.serviceAccount }} serviceAccountName: {{ .Values.solr.serviceAccount }} {{- end }} diff --git a/xenit-alfresco/values.yaml b/xenit-alfresco/values.yaml index 23e75b9..6372d89 100644 --- a/xenit-alfresco/values.yaml +++ b/xenit-alfresco/values.yaml @@ -151,6 +151,7 @@ postgresql: solr: enabled: true replicas: 2 + enforceZoneAntiAffinity: false podManagementPolicy: Parallel image: registry: 'docker.io'