From 64a5308dc786e76bc2e1f2429cab6b73b13fc2c7 Mon Sep 17 00:00:00 2001 From: Jacob LeGrone Date: Sat, 8 Sep 2018 16:35:12 -0400 Subject: [PATCH] [stable/redis] Rollout new pods on configuration changes (#7619) * Rename secrets.yaml to secret.yaml Signed-off-by: Jacob LeGrone * Perform rolling update when configuration changes Signed-off-by: Jacob LeGrone * Interpret redis.conf contents as string Signed-off-by: Jacob LeGrone * Bump chart version Signed-off-by: Jacob LeGrone --- stable/redis/Chart.yaml | 2 +- stable/redis/templates/configmap.yaml | 2 +- stable/redis/templates/redis-master-statefulset.yaml | 4 +++- stable/redis/templates/redis-slave-deployment.yaml | 4 +++- stable/redis/templates/{secrets.yaml => secret.yaml} | 0 stable/redis/values.yaml | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) rename stable/redis/templates/{secrets.yaml => secret.yaml} (100%) diff --git a/stable/redis/Chart.yaml b/stable/redis/Chart.yaml index 9e0aff1064..b9a057fbe0 100644 --- a/stable/redis/Chart.yaml +++ b/stable/redis/Chart.yaml @@ -1,5 +1,5 @@ name: redis -version: 3.8.1 +version: 3.9.0 appVersion: 4.0.11 description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. keywords: diff --git a/stable/redis/templates/configmap.yaml b/stable/redis/templates/configmap.yaml index 22e4fa06b0..b930960795 100644 --- a/stable/redis/templates/configmap.yaml +++ b/stable/redis/templates/configmap.yaml @@ -10,5 +10,5 @@ metadata: name: {{ template "redis.fullname" . }} data: redis.conf: |- -{{ toYaml .Values.configmap | indent 4 }} +{{ .Values.configmap | indent 4 }} {{- end }} diff --git a/stable/redis/templates/redis-master-statefulset.yaml b/stable/redis/templates/redis-master-statefulset.yaml index ac1f53bfed..5217831423 100644 --- a/stable/redis/templates/redis-master-statefulset.yaml +++ b/stable/redis/templates/redis-master-statefulset.yaml @@ -25,8 +25,10 @@ spec: {{- if .Values.master.podLabels }} {{ toYaml .Values.master.podLabels | indent 8 }} {{- end }} - {{- if .Values.master.podAnnotations }} annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} + {{- if .Values.master.podAnnotations }} {{ toYaml .Values.master.podAnnotations | indent 8 }} {{- end }} spec: diff --git a/stable/redis/templates/redis-slave-deployment.yaml b/stable/redis/templates/redis-slave-deployment.yaml index 1263579d74..1e25c5cece 100644 --- a/stable/redis/templates/redis-slave-deployment.yaml +++ b/stable/redis/templates/redis-slave-deployment.yaml @@ -22,8 +22,10 @@ spec: {{- if (.Values.slave.podLabels | default .Values.master.podLabels) }} {{ toYaml (.Values.slave.podLabels | default .Values.master.podLabels) | indent 8 }} {{- end }} - {{- if (.Values.slave.podAnnotations | default .Values.master.podAnnotations) }} annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} + {{- if (.Values.slave.podAnnotations | default .Values.master.podAnnotations) }} {{ toYaml (.Values.slave.podAnnotations | default .Values.master.podAnnotations) | indent 8 }} {{- end }} spec: diff --git a/stable/redis/templates/secrets.yaml b/stable/redis/templates/secret.yaml similarity index 100% rename from stable/redis/templates/secrets.yaml rename to stable/redis/templates/secret.yaml diff --git a/stable/redis/values.yaml b/stable/redis/values.yaml index e174a19e7f..48885aa368 100644 --- a/stable/redis/values.yaml +++ b/stable/redis/values.yaml @@ -203,7 +203,7 @@ master: ## Update strategy, can be set to RollingUpdate or onDelete by default. ## https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets statefulset: - updateStrategy: OnDelete + updateStrategy: RollingUpdate ## Partition update strategy ## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions # rollingUpdatePartition: