From b785c46af5763edd6747462a0976c9925966fc45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= Date: Mon, 15 Jun 2020 16:50:44 +0200 Subject: [PATCH] Elasticsearch: set PVC labels through setting all StatefulSet labels to its volumeClaimTemplate. Allows to track created PVCs (example: delete all PVCs from this recently deleted Release). --- elasticsearch/templates/statefulset.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/elasticsearch/templates/statefulset.yaml b/elasticsearch/templates/statefulset.yaml index acb1afbc8..7da66f1aa 100644 --- a/elasticsearch/templates/statefulset.yaml +++ b/elasticsearch/templates/statefulset.yaml @@ -26,6 +26,14 @@ spec: volumeClaimTemplates: - metadata: name: {{ template "elasticsearch.uname" . }} + labels: + heritage: {{ .Release.Service | quote }} + release: {{ .Release.Name | quote }} + chart: "{{ .Chart.Name }}" + app: "{{ template "elasticsearch.uname" . }}" + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} {{- with .Values.persistence.annotations }} annotations: {{ toYaml . | indent 8 }}