From 3573f67e950315602bae71e787a12c70d4f59364 Mon Sep 17 00:00:00 2001 From: Philipp Eberle Date: Mon, 22 Feb 2021 14:29:41 +0100 Subject: [PATCH] Add a random label to the pods when configured to do so (forces reload of pod, which can be used in combination with image.pullPolicy=Always to force a reload of the used image) --- charts/postgreslet/templates/deployment.yaml | 3 +++ charts/postgreslet/values.yaml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/charts/postgreslet/templates/deployment.yaml b/charts/postgreslet/templates/deployment.yaml index e03f7fc6..a658395c 100644 --- a/charts/postgreslet/templates/deployment.yaml +++ b/charts/postgreslet/templates/deployment.yaml @@ -21,6 +21,9 @@ spec: {{- end }} labels: control-plane: controller-manager +{{- if .Values.addRandomLabel }} + random-label-to-force-reload: {{ randAlphaNum 12 | quote }} +{{- end }} {{- include "postgreslet.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} diff --git a/charts/postgreslet/values.yaml b/charts/postgreslet/values.yaml index a370e950..d5076026 100644 --- a/charts/postgreslet/values.yaml +++ b/charts/postgreslet/values.yaml @@ -76,3 +76,7 @@ postgreslet: # customPspName The name to use for our custom psp # If not set, a name is generated using the fullname template customPspName: "" + +# addRandomLabel adds a random label each time the deployment.yaml is rendered, forcing k8s to update that deployment. +# In combination with image.PullPolicy=Always, this effetifely forces a reload of the pod, even if the image tag stays the same. +addRandomLabel: false \ No newline at end of file