Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NYS2AWS-71] allow node anti-affinity for Solr pods #166

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<br>
<b>Please note that switching off the anti-affinity does not alter the anti-affinity of the already running pods!</b>

#### `solr.serviceAccount`

* Required: false
Expand Down
12 changes: 12 additions & 0 deletions xenit-alfresco/templates/solr/solr-stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions xenit-alfresco/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ postgresql:
solr:
enabled: true
replicas: 2
enforceZoneAntiAffinity: false
podManagementPolicy: Parallel
image:
registry: 'docker.io'
Expand Down
Loading