Skip to content

Commit

Permalink
[NYS2AWS-71] allow node anti-affinity for Solr pods
Browse files Browse the repository at this point in the history
  • Loading branch information
pvriel committed Nov 6, 2024
1 parent d8660d0 commit c4e9660
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
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.enforceHostnameAntiAffinity

[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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,14 @@ 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.enforceHostnameAntiAffinity`

* Required: false
* Default: false
* Description: If true, this option enforces a pod anti-affinity on the Solr pods based on the hostnames.
I.e. if true, each Solr pod will require a unique node. Starting more pods than nodes will put the
remainder pods in a `Pending` state.

#### `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.enforceHostnameAntiAffinity }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
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
enforceHostnameAntiAffinity: false
podManagementPolicy: Parallel
image:
registry: 'docker.io'
Expand Down

0 comments on commit c4e9660

Please sign in to comment.