From ed54111f0c4670a8a25176dc68e57a3385eaec93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= Date: Thu, 25 Jun 2020 17:40:43 +0200 Subject: [PATCH] add an opt-in parameter to enable volumeClaimTemplate labels. --- elasticsearch/templates/statefulset.yaml | 2 ++ elasticsearch/values.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/elasticsearch/templates/statefulset.yaml b/elasticsearch/templates/statefulset.yaml index 7063451cb..f79b1a08e 100644 --- a/elasticsearch/templates/statefulset.yaml +++ b/elasticsearch/templates/statefulset.yaml @@ -26,6 +26,7 @@ spec: volumeClaimTemplates: - metadata: name: {{ template "elasticsearch.uname" . }} + {{- if .Values.labels.enabled }} labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -34,6 +35,7 @@ spec: {{- range $key, $value := .Values.labels }} {{ $key }}: {{ $value | quote }} {{- end }} + {{- end }} {{- with .Values.persistence.annotations }} annotations: {{ toYaml . | indent 8 }} diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index f5a162b99..75b91b231 100755 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -118,6 +118,9 @@ podSecurityPolicy: persistence: enabled: true + labels: + # Add default labels for the volumeClaimTemplate fo the StatefulSet + enabled: false annotations: {} extraVolumes: []