Skip to content

Commit 896d315

Browse files
authored
Merge pull request #114 from elastic/state_of_mind
[elasticsearch] Make persistent volumes optional
2 parents da8d858 + 2fecad9 commit 896d315

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

elasticsearch/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ helm install --name elasticsearch elastic/elasticsearch --version 7.0.0-alpha1 -
8080
| `networkHost` | Value for the [network.host Elasticsearch setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/network.host.html) | `0.0.0.0` |
8181
| `volumeClaimTemplate` | Configuration for the [volumeClaimTemplate for statefulsets](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-storage). You will want to adjust the storage (default `30Gi`) and the `storageClassName` if you are using a different storage class | `accessModes: [ "ReadWriteOnce" ]`<br>`resources.requests.storage: 30Gi` |
8282
| `persistence.annotations` | Additional persistence annotations for the `volumeClaimTemplate` | `{}` |
83+
| `persistence.enabled` | Enables a persistent volume for Elasticsearch data. Can be disabled for nodes that only have [roles](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html) which don't require persistent data. | `true` |
8384
| `antiAffinityTopologyKey` | The [anti-affinity topology key](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). By default this will prevent multiple Elasticsearch nodes from running on the same Kubernetes node | `kubernetes.io/hostname` |
8485
| `antiAffinity` | Setting this to hard enforces the [anti-affinity rules](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). If it is set to soft it will be done "best effort". Other values will be ignored. | `hard` |
8586
| `nodeAffinity` | Value for the [node affinity settings](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) | `{}` |

elasticsearch/templates/statefulset.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ spec:
1717
podManagementPolicy: {{ .Values.podManagementPolicy }}
1818
updateStrategy:
1919
type: {{ .Values.updateStrategy }}
20+
{{- if .Values.persistence.enabled }}
2021
volumeClaimTemplates:
2122
- metadata:
2223
name: {{ template "uname" . }}
@@ -26,6 +27,7 @@ spec:
2627
{{- end }}
2728
spec:
2829
{{ toYaml .Values.volumeClaimTemplate | indent 6 }}
30+
{{- end }}
2931
template:
3032
metadata:
3133
name: "{{ template "uname" . }}"
@@ -195,8 +197,10 @@ spec:
195197
{{ toYaml .Values.extraEnvs | indent 10 }}
196198
{{- end }}
197199
volumeMounts:
200+
{{- if .Values.persistence.enabled }}
198201
- name: "{{ template "uname" . }}"
199202
mountPath: /usr/share/elasticsearch/data
203+
{{- end }}
200204
{{- range .Values.secretMounts }}
201205
- name: {{ .name }}
202206
mountPath: {{ .path }}

elasticsearch/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ volumeClaimTemplate:
7676
storage: 30Gi
7777

7878
persistence:
79+
enabled: true
7980
annotations: {}
8081

8182
extraVolumes: []

0 commit comments

Comments
 (0)