diff --git a/bin/upgrade-scripts/to-2.0/upgrade.sh b/bin/upgrade-scripts/to-2.0/upgrade.sh index e4fc65808ef826b9317a8390d72229eb2a609302..9399406e0a6b731d0924cc566e8c478c459dbf2f 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 06ac1623e7bbd33f9c4d884a4e916fc195cce797..ba07460abdfe3d4ef9e7dde24276821cdcfdece9 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 @@ -17,9 +17,11 @@ spec: interval: 1h install: timeout: 30m + remediation: + retries: 1 upgrade: remediation: - retries: 2 + retries: 1 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 97f894aa3b1fccbee8d4bd19d25ab56d5484afb0..2efd499ffccd64227d0d34fbdbf0f61138cad1ed 100644 --- a/flux2/apps/zulip/zulip-values-configmap.yaml +++ b/flux2/apps/zulip/zulip-values-configmap.yaml @@ -119,9 +119,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 @@ -129,6 +134,8 @@ data: cpu: 10m memory: 256Mi primary: + persistence: + existingClaim: zulip-postgres podAnnotations: backup.velero.io/backup-volumes: "data" commonLabels: