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

Allow setting of volumeClaimDeletePolicy in eck-elasticsearch Helm chart #6409

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion deploy/eck-elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: eck-elasticsearch
description: A Helm chart to deploy Elasticsearch managed by the ECK Operator.
kubeVersion: ">= 1.21.0-0"
type: application
version: 0.3.0
version: 0.4.0
naemono marked this conversation as resolved.
Show resolved Hide resolved
sources:
- https://github.com/elastic/cloud-on-k8s
- https://github.com/elastic/elasticsearch/
Expand Down
7 changes: 7 additions & 0 deletions deploy/eck-elasticsearch/templates/elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ spec:
remoteClusters:
{{- toYaml .Values.remoteClusters | nindent 2 }}
{{- end }}
{{- if .Values.volumeClaimDeletePolicy }}
volumeClaimDeletePolicy:
{{- if and (not (eq .Values.volumeClaimDeletePolicy "DeleteOnScaledownOnly")) (not (eq .Values.volumeClaimDeletePolicy "DeleteOnScaledownAndClusterDeletion")) }}
{{ fail "volumeClaimDeletePolicy can only be one of 'DeleteOnScaledownOnly' or 'DeleteOnScaledownAndClusterDeletion'" }}
{{- end }}
{{- toYaml .Values.volumeClaimDeletePolicy | nindent 4 }}
{{- end }}
{{- if eq (len .Values.nodeSets) 0 }}
{{ fail "At least one nodeSet is required" }}
{{- end }}
Expand Down
21 changes: 20 additions & 1 deletion deploy/eck-elasticsearch/templates/tests/elasticsearch_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ tests:
- equal:
path: metadata.name
value: override
- it: setting volumeClaimDeletePolicy should work properly
set:
volumeClaimDeletePolicy: DeleteOnScaledownOnly
release:
name: quickstart
asserts:
- isKind:
of: Elasticsearch
- equal:
path: spec.volumeClaimDeletePolicy
value: DeleteOnScaledownOnly
- it: setting volumeClaimDeletePolicy incorrectly should fail
set:
volumeClaimDeletePolicy: invalid
release:
name: quickstart
asserts:
- failedTemplate:
errorMessage: volumeClaimDeletePolicy can only be one of 'DeleteOnScaledownOnly' or 'DeleteOnScaledownAndClusterDeletion'
- it: should render labels, annotations, and additional custom values properly
set:
labels:
Expand Down Expand Up @@ -89,7 +108,7 @@ tests:
app.kubernetes.io/instance: quickstart
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: eck-elasticsearch
helm.sh/chart: eck-elasticsearch-0.3.0
helm.sh/chart: eck-elasticsearch-0.4.0
naemono marked this conversation as resolved.
Show resolved Hide resolved
test: label
- equal:
path: metadata.annotations
Expand Down
5 changes: 5 additions & 0 deletions deploy/eck-elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ remoteClusters: {}
# name: cluster-two
# namespace: ns-two

# VolumeClaimDeletePolicy sets the policy for handling deletion of PersistentVolumeClaims for all NodeSets.
# Possible values are DeleteOnScaledownOnly and DeleteOnScaledownAndClusterDeletion.
# Defaults to DeleteOnScaledownAndClusterDeletion if unset.
volumeClaimDeletePolicy: ""

# Node configuration settings.
# The node roles which can be configured here are:
# - "master"
Expand Down
2 changes: 1 addition & 1 deletion deploy/eck-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ version: 0.4.0
dependencies:
- name: eck-elasticsearch
condition: eck-elasticsearch.enabled
version: "0.3.0"
version: "0.4.0"
naemono marked this conversation as resolved.
Show resolved Hide resolved
# uncomment for local testing, and comment
# the helm.elastic.co repository.
# repository: "file://../eck-elasticsearch"
Expand Down