Skip to content

Commit 5eda72c

Browse files
committed
[bitnami/elasticsearch] Allow custom node affinity policy
1 parent 06c8060 commit 5eda72c

File tree

8 files changed

+37
-9
lines changed

8 files changed

+37
-9
lines changed

bitnami/elasticsearch/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: elasticsearch
2-
version: 4.2.10
2+
version: 4.3.0
33
appVersion: 6.6.0
44
description: A highly scalable open-source full-text search and analytics engine
55
keywords:

bitnami/elasticsearch/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The following table lists the configurable parameters of the Elasticsearch chart
6464
| `master.replicas` | Desired number of Elasticsearch master-eligible nodes | `2` |
6565
| `master.heapSize` | Master-eligible node heap size | `128m` |
6666
| `master.antiAffinity` | Master-eligible node pod anti-affinity policy | `soft` |
67+
| `coordinating.nodeAffinity` | Master-eligible node affinity policy | `nil` |
6768
| `master.service.type` | Kubernetes Service type (master-eligible nodes) | `ClusterIP` |
6869
| `master.service.port` | Kubernetes Service port for Elasticsearch transport port (master-eligible nodes) | `9300` |
6970
| `master.service.nodePort` | Kubernetes Service nodePort (master-eligible nodes) | `nil` |
@@ -90,6 +91,7 @@ The following table lists the configurable parameters of the Elasticsearch chart
9091
| `coordinating.replicas` | Desired number of Elasticsearch coordinating-only nodes | `2` |
9192
| `coordinating.heapSize` | Coordinating-only node heap size | `128m` |
9293
| `coordinating.antiAffinity` | Coordinating-only node pod anti-affinity policy | `soft` |
94+
| `coordinating.nodeAffinity` | Coordinating-only node affinity policy | `nil` |
9395
| `coordinating.service.type` | Kubernetes Service type (coordinating-only nodes) | `ClusterIP` |
9496
| `coordinating.service.port` | Kubernetes Service port for REST API (coordinating-only nodes) | `9200` |
9597
| `coordinating.service.nodePort` | Kubernetes Service nodePort (coordinating-only nodes) | `nil` |
@@ -112,6 +114,7 @@ The following table lists the configurable parameters of the Elasticsearch chart
112114
| `data.replicas` | Desired number of Elasticsearch data nodes nodes | `3` |
113115
| `data.heapSize` | Data node heap size | `1024m` |
114116
| `data.antiAffinity` | Data pod anti-affinity policy | `soft` |
117+
| `data.nodeAffinity` | Data pod node affinity policy | `nil` |
115118
| `data.resources` | CPU/Memory resource requests/limits for data nodes | `requests: { cpu: "25m", memory: "1152Mi" }` |
116119
| `data.persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` | `true` |
117120
| `data.persistence.annotations` | Persistent Volume Claim annotations | `{}` |
@@ -135,6 +138,7 @@ The following table lists the configurable parameters of the Elasticsearch chart
135138
| `ingest.replicas` | Desired number of Elasticsearch ingest nodes | `2` |
136139
| `ingest.heapSize` | Ingest node heap size | `128m` |
137140
| `ingest.antiAffinity` | Ingest node pod anti-affinity policy | `soft` |
141+
| `ingest.nodeAffinity` | Ingest node pod affinity policy | `nil` |
138142
| `ingest.service.type` | Kubernetes Service type (ingest nodes) | `ClusterIP` |
139143
| `ingest.service.port` | Kubernetes Service port Elasticsearch transport port (ingest nodes) | `9300` |
140144
| `ingest.service.nodePort` | Kubernetes Service nodePort (ingest nodes) | `nil` |

bitnami/elasticsearch/templates/coordinating-deploy.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ spec:
2626
securityContext:
2727
fsGroup: {{ .Values.securityContext.fsGroup }}
2828
{{- end }}
29-
{{- if eq .Values.coordinating.antiAffinity "hard" }}
3029
affinity:
30+
{{- if eq .Values.coordinating.antiAffinity "hard" }}
3131
podAntiAffinity:
3232
requiredDuringSchedulingIgnoredDuringExecution:
3333
- topologyKey: "kubernetes.io/hostname"
@@ -37,7 +37,6 @@ spec:
3737
release: {{ .Release.Name | quote }}
3838
role: "coordinating-only"
3939
{{- else if eq .Values.coordinating.antiAffinity "soft" }}
40-
affinity:
4140
podAntiAffinity:
4241
preferredDuringSchedulingIgnoredDuringExecution:
4342
- weight: 1
@@ -49,6 +48,9 @@ spec:
4948
release: {{ .Release.Name | quote }}
5049
role: "coordinating-only"
5150
{{- end }}
51+
{{- if .Values.coordinating.nodeAffinity }}
52+
{{ toYaml .Values.coordinating.nodeAffinity | indent 8 }}
53+
{{- end }}
5254
{{- if .Values.image.pullSecrets }}
5355
imagePullSecrets:
5456
{{- range .Values.image.pullSecrets }}

bitnami/elasticsearch/templates/data-statefulset.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ spec:
2828
securityContext:
2929
fsGroup: {{ .Values.securityContext.fsGroup }}
3030
{{- end }}
31-
{{- if eq .Values.data.antiAffinity "hard" }}
3231
affinity:
32+
{{- if eq .Values.data.antiAffinity "hard" }}
3333
podAntiAffinity:
3434
requiredDuringSchedulingIgnoredDuringExecution:
3535
- topologyKey: "kubernetes.io/hostname"
@@ -39,7 +39,6 @@ spec:
3939
release: {{ .Release.Name | quote }}
4040
role: "data"
4141
{{- else if eq .Values.data.antiAffinity "soft" }}
42-
affinity:
4342
podAntiAffinity:
4443
preferredDuringSchedulingIgnoredDuringExecution:
4544
- weight: 1
@@ -51,6 +50,9 @@ spec:
5150
release: {{ .Release.Name | quote }}
5251
role: "data"
5352
{{- end }}
53+
{{- if .Values.data.nodeAffinity }}
54+
{{ toYaml .Values.data.nodeAffinity | indent 8 }}
55+
{{- end }}
5456
{{- if .Values.sysctlImage.enabled }}
5557
## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
5658
initContainers:

bitnami/elasticsearch/templates/ingest-deploy.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ spec:
2727
securityContext:
2828
fsGroup: {{ .Values.securityContext.fsGroup }}
2929
{{- end }}
30-
{{- if eq .Values.ingest.antiAffinity "hard" }}
3130
affinity:
31+
{{- if eq .Values.ingest.antiAffinity "hard" }}
3232
podAntiAffinity:
3333
requiredDuringSchedulingIgnoredDuringExecution:
3434
- topologyKey: "kubernetes.io/hostname"
@@ -38,7 +38,6 @@ spec:
3838
release: {{ .Release.Name | quote }}
3939
role: "ingest"
4040
{{- else if eq .Values.ingest.antiAffinity "soft" }}
41-
affinity:
4241
podAntiAffinity:
4342
preferredDuringSchedulingIgnoredDuringExecution:
4443
- weight: 1
@@ -50,6 +49,9 @@ spec:
5049
release: {{ .Release.Name | quote }}
5150
role: "ingest"
5251
{{- end }}
52+
{{- if .Values.ingest.nodeAffinity }}
53+
{{ toYaml .Values.ingest.nodeAffinity | indent 8 }}
54+
{{- end }}
5355
{{- if .Values.image.pullSecrets }}
5456
imagePullSecrets:
5557
{{- range .Values.image.pullSecrets }}

bitnami/elasticsearch/templates/master-deploy.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ spec:
2727
securityContext:
2828
fsGroup: {{ .Values.securityContext.fsGroup }}
2929
{{- end }}
30-
{{- if eq .Values.master.antiAffinity "hard" }}
3130
affinity:
31+
{{- if eq .Values.master.antiAffinity "hard" }}
3232
podAntiAffinity:
3333
requiredDuringSchedulingIgnoredDuringExecution:
3434
- topologyKey: "kubernetes.io/hostname"
@@ -38,7 +38,6 @@ spec:
3838
release: {{ .Release.Name | quote }}
3939
role: "master"
4040
{{- else if eq .Values.master.antiAffinity "soft" }}
41-
affinity:
4241
podAntiAffinity:
4342
preferredDuringSchedulingIgnoredDuringExecution:
4443
- weight: 1
@@ -50,6 +49,9 @@ spec:
5049
release: {{ .Release.Name | quote }}
5150
role: "master"
5251
{{- end }}
52+
{{- if .Values.master.nodeAffinity }}
53+
{{ toYaml .Values.master.nodeAffinity | indent 8 }}
54+
{{- end }}
5355
{{- if .Values.image.pullSecrets }}
5456
imagePullSecrets:
5557
{{- range .Values.image.pullSecrets }}

bitnami/elasticsearch/values-production.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ master:
4444
replicas: 3
4545
heapSize: 128m
4646
antiAffinity: "soft"
47+
## node affinity
48+
# nodeAffinity:
4749
service:
4850
## master-eligible service type
4951
type: ClusterIP
@@ -124,6 +126,8 @@ coordinating:
124126
replicas: 2
125127
heapSize: 128m
126128
antiAffinity: "soft"
129+
## node affinity
130+
# nodeAffinity:
127131
service:
128132
## coordinating-only service type
129133
type: ClusterIP
@@ -172,6 +176,8 @@ data:
172176
replicas: 3
173177
heapSize: 1024m
174178
antiAffinity: "soft"
179+
## node affinity
180+
# nodeAffinity:
175181
## Configure resource requests and limits
176182
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
177183
##
@@ -232,6 +238,8 @@ ingest:
232238
replicas: 2
233239
heapSize: 128m
234240
antiAffinity: "soft"
241+
## node affinity
242+
# nodeAffinity:
235243
service:
236244
## ingest service type
237245
type: ClusterIP

bitnami/elasticsearch/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ master:
6363
replicas: 2
6464
heapSize: 128m
6565
antiAffinity: "soft"
66+
## node affinity
67+
# nodeAffinity:
6668
service:
6769
## master-eligible service type
6870
type: ClusterIP
@@ -127,6 +129,8 @@ coordinating:
127129
replicas: 2
128130
heapSize: 128m
129131
antiAffinity: "soft"
132+
## node affinity
133+
# nodeAffinity:
130134
service:
131135
## coordinating-only service type
132136
type: ClusterIP
@@ -175,6 +179,8 @@ data:
175179
replicas: 2
176180
heapSize: 1024m
177181
antiAffinity: "soft"
182+
## node affinity
183+
# nodeAffinity:
178184
## Configure resource requests and limits
179185
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
180186
##
@@ -235,6 +241,8 @@ ingest:
235241
replicas: 2
236242
heapSize: 128m
237243
antiAffinity: "soft"
244+
## node affinity
245+
# nodeAffinity:
238246
service:
239247
## ingest service type
240248
type: ClusterIP

0 commit comments

Comments
 (0)