From 9616172a1d8fb6cf15b46d0719d5ffde0b8fa6d6 Mon Sep 17 00:00:00 2001 From: Arie Peterson Date: Thu, 2 Jun 2022 16:49:46 +0200 Subject: [PATCH 1/3] Upgrade zulip chart to 0.3.0 --- flux2/apps/zulip/release.yaml | 8 ++++++-- flux2/apps/zulip/zulip-values-configmap.yaml | 13 ++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/flux2/apps/zulip/release.yaml b/flux2/apps/zulip/release.yaml index 06ac1623..b1c9f149 100644 --- a/flux2/apps/zulip/release.yaml +++ b/flux2/apps/zulip/release.yaml @@ -9,7 +9,7 @@ spec: chart: spec: chart: zulip - version: 0.2.1 + version: 0.3.0 sourceRef: kind: HelmRepository name: zulip-helm-chart @@ -19,7 +19,11 @@ spec: timeout: 30m upgrade: remediation: - retries: 2 + retries: 1 + # Uninstall the old version of zulip when upgrading fails. + # We needed this at least for the upgrade of the postgres dependency to + # chart version 11. + strategy: uninstall valuesFrom: - kind: ConfigMap name: stackspin-zulip-values diff --git a/flux2/apps/zulip/zulip-values-configmap.yaml b/flux2/apps/zulip/zulip-values-configmap.yaml index fe2c404c..b7be8a32 100644 --- a/flux2/apps/zulip/zulip-values-configmap.yaml +++ b/flux2/apps/zulip/zulip-values-configmap.yaml @@ -107,9 +107,14 @@ data: postgresql: image: tag: 14 - persistence: - existingClaim: zulip-postgres - postgresqlPassword: "${postgresql_password}" + auth: + # Note: the old version (< 0.3.0) of this chart always used the + # postgresql admin password to log in. since 0.3.0 it uses a user + # password, but because we can't update the passwords in currently + # running postgresql instances through helm, we use the same password + # for both. + postgresqlPassword: "${postgresql_password}" + password: "${postgresql_password}" resources: limits: memory: 512Mi @@ -117,6 +122,8 @@ data: cpu: 10m memory: 256Mi primary: + persistence: + existingClaim: zulip-postgres podAnnotations: backup.velero.io/backup-volumes: "data" commonLabels: -- GitLab From 02552cf4ead529761426b01d07c6482a2962b0f0 Mon Sep 17 00:00:00 2001 From: Arie Peterson Date: Tue, 7 Jun 2022 16:54:22 +0200 Subject: [PATCH 2/3] Retry failed flux install of zulip --- flux2/apps/zulip/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux2/apps/zulip/release.yaml b/flux2/apps/zulip/release.yaml index b1c9f149..2fce805b 100644 --- a/flux2/apps/zulip/release.yaml +++ b/flux2/apps/zulip/release.yaml @@ -17,6 +17,8 @@ spec: interval: 1h install: timeout: 30m + remediation: + retries: 1 upgrade: remediation: retries: 1 -- GitLab From 2e24bf095be3245a70b80971bc1cb127312dc921 Mon Sep 17 00:00:00 2001 From: Arie Peterson Date: Thu, 29 Sep 2022 16:02:23 +0200 Subject: [PATCH 3/3] Temporarily uninstall zulip in 2.0 upgrade script --- bin/upgrade-scripts/to-2.0/upgrade.sh | 33 ++++++++++++++++++++------- flux2/apps/zulip/release.yaml | 4 ---- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/bin/upgrade-scripts/to-2.0/upgrade.sh b/bin/upgrade-scripts/to-2.0/upgrade.sh index e4fc6580..9399406e 100755 --- a/bin/upgrade-scripts/to-2.0/upgrade.sh +++ b/bin/upgrade-scripts/to-2.0/upgrade.sh @@ -2,11 +2,28 @@ set -euo pipefail -# Suspend the kube-prometheus-stack helmRelease so it cannot recreate a -# failing v0.39 daemonset -flux suspend helmrelease -n stackspin kube-prometheus-stack -# Delete kube-prometheus-stack-prometheus-node-exporter daemonset, needed -# for upgrade to kube-prometheus-stack v0.40.0 -# see https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack#from-39-x-to-40-x -kubectl -n stackspin delete daemonset kube-prometheus-stack-prometheus-node-exporter -flux resume helmrelease -n stackspin kube-prometheus-stack +# Check if zulip is installed at all. +if helm ls -n stackspin-apps | grep -q zulip +then + zulip="true" +else + zulip="false" +fi + +# Prepare before upgrade. +# For background, see +# https://open.greenhost.net/stackspin/stackspin/-/issues/1250 +if [ $zulip == "true" ] +then + flux suspend helmrelease -n stackspin-apps zulip + # Temporarily uninstall zulip. + helm uninstall -n stackspin-apps zulip +fi + +# Now do the actual upgrade, by instructing flux to switch to the v2 branch. +kubectl patch -n flux-system gitrepository stackspin -p '{"spec":{"ref":{"branch":"v2"}}}' --type="merge" + +if [ $zulip == "true" ] +then + flux resume helmrelease -n stackspin-apps zulip +fi diff --git a/flux2/apps/zulip/release.yaml b/flux2/apps/zulip/release.yaml index 2fce805b..ba07460a 100644 --- a/flux2/apps/zulip/release.yaml +++ b/flux2/apps/zulip/release.yaml @@ -22,10 +22,6 @@ spec: upgrade: remediation: retries: 1 - # Uninstall the old version of zulip when upgrading fails. - # We needed this at least for the upgrade of the postgres dependency to - # chart version 11. - strategy: uninstall valuesFrom: - kind: ConfigMap name: stackspin-zulip-values -- GitLab