From 52c2d2c16325c5792dfa97f64b00549da0ac5bd2 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 22 Jan 2025 18:38:44 +0100 Subject: [PATCH] allow omitting the identity migration pre-upgrade hook --- charts/ziti-router/templates/pre-upgrade-configmap.yaml | 5 +++-- charts/ziti-router/templates/pre-upgrade-job.yaml | 3 +++ charts/ziti-router/templates/pre-upgrade-serviceaccount.yaml | 4 +++- charts/ziti-router/values.yaml | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/charts/ziti-router/templates/pre-upgrade-configmap.yaml b/charts/ziti-router/templates/pre-upgrade-configmap.yaml index 7c369117..7bdb5474 100644 --- a/charts/ziti-router/templates/pre-upgrade-configmap.yaml +++ b/charts/ziti-router/templates/pre-upgrade-configmap.yaml @@ -1,4 +1,4 @@ - +{{if not .Values.omitIdentityMigration}} --- apiVersion: v1 kind: ConfigMap @@ -78,4 +78,5 @@ data: {{ include "ziti-router.fullname" . }}-identity else echo "INFO: identity secret does not exist" - fi \ No newline at end of file + fi +{{end}} \ No newline at end of file diff --git a/charts/ziti-router/templates/pre-upgrade-job.yaml b/charts/ziti-router/templates/pre-upgrade-job.yaml index 488ad052..cb9e9960 100644 --- a/charts/ziti-router/templates/pre-upgrade-job.yaml +++ b/charts/ziti-router/templates/pre-upgrade-job.yaml @@ -1,3 +1,5 @@ +{{if not .Values.omitIdentityMigration}} +--- apiVersion: batch/v1 kind: Job metadata: @@ -72,3 +74,4 @@ spec: {{- else }} emptyDir: {} {{- end }} +{{end}} \ No newline at end of file diff --git a/charts/ziti-router/templates/pre-upgrade-serviceaccount.yaml b/charts/ziti-router/templates/pre-upgrade-serviceaccount.yaml index 8cd05e77..32bea50b 100644 --- a/charts/ziti-router/templates/pre-upgrade-serviceaccount.yaml +++ b/charts/ziti-router/templates/pre-upgrade-serviceaccount.yaml @@ -1,4 +1,5 @@ - +{{if not .Values.omitIdentityMigration}} +--- apiVersion: v1 kind: ServiceAccount metadata: @@ -40,3 +41,4 @@ subjects: - kind: ServiceAccount name: {{ include "ziti-router.fullname" . }}-hook-serviceaccount namespace: {{ .Release.Namespace }} +{{end}} \ No newline at end of file diff --git a/charts/ziti-router/values.yaml b/charts/ziti-router/values.yaml index ad0e697d..a4ca60f6 100644 --- a/charts/ziti-router/values.yaml +++ b/charts/ziti-router/values.yaml @@ -360,6 +360,11 @@ tolerations: [] # -- deployment template spec affinity affinity: {} +# -- omit migration of identity secret to persistent volume +# Previous versions of this chart stored the router identity in a secret resource. A migration is provided by the execution of a pre-upgrade hook. +# If want to omit this migration (pre-upgrade hook) set this value to true. +omitIdentityMigration: false + ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ##