From 4fcb0b0d338e923f31d2be4c44db0f533aef7d9f Mon Sep 17 00:00:00 2001 From: Francesco Lanciana Date: Tue, 26 Feb 2019 07:10:57 +1100 Subject: [PATCH] [stable/redis-ha] Allow for custom labels on redis pod (#11634) * [stable/redis-ha] Allow for custom labels on redis pod Signed-off-by: Francesco Lanciana *What this PR does / why we need it:* * Added the ability to assign extra labels to the redis pod (in addition to the release and app labels) Currently there is no way to assign custom labels to the redis pod, however it is occasionally necessary for custom labels to be assigned to the pod. An example may be a label that is used to enforce a certain network security policy (this is our particular use case). Without this we are completely unable to proceed with this particular helm chart. Signed-off-by: Francesco Lanciana * [stable/redis-ha] Updated the semver minor version Signed-off-by: Francesco Lanciana Updated the minor version for this chart as new functionality (the ability to add custom labels) was added to the chart. This is fully backwards compatible. Signed-off-by: Francesco Lanciana * [stable/redis-ha] Added labels map to values.yaml Signed-off-by: Francesco Lanciana Added labels map to the values.yaml (base config for the chart) Signed-off-by: Francesco Lanciana * [stable/redis-ha] Indentation for labels line in yaml no longer greater than 8 spaces Signed-off-by: Francesco Lanciana This line doesn't need to be indented more than 8 spaces Signed-off-by: Francesco Lanciana --- stable/redis-ha/Chart.yaml | 2 +- stable/redis-ha/templates/redis-ha-statefulset.yaml | 3 +++ stable/redis-ha/values.yaml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stable/redis-ha/Chart.yaml b/stable/redis-ha/Chart.yaml index 179ab774f4..660e9bf337 100644 --- a/stable/redis-ha/Chart.yaml +++ b/stable/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 3.1.6 +version: 3.2.0 appVersion: 5.0.3 description: Highly available Kubernetes implementation of Redis icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png diff --git a/stable/redis-ha/templates/redis-ha-statefulset.yaml b/stable/redis-ha/templates/redis-ha-statefulset.yaml index 1fc9062e72..3fde614608 100644 --- a/stable/redis-ha/templates/redis-ha-statefulset.yaml +++ b/stable/redis-ha/templates/redis-ha-statefulset.yaml @@ -30,6 +30,9 @@ spec: labels: release: {{ .Release.Name }} app: {{ template "redis-ha.name" . }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value }} + {{- end }} spec: {{- if .Values.nodeSelector }} nodeSelector: diff --git a/stable/redis-ha/values.yaml b/stable/redis-ha/values.yaml index ced15a008c..6e118f064b 100644 --- a/stable/redis-ha/values.yaml +++ b/stable/redis-ha/values.yaml @@ -8,6 +8,9 @@ image: ## replicas number for each component replicas: 3 +## Custom labels for the redis pod +labels: {} + ## Redis specific configuration options redis: port: 6379