Skip to content

Commit 50623fb

Browse files
author
Simon Emms
committed
[kots]: handle issues with upgrading from previous version
Also increased the HELM_TIMEOUT to 10m (from 5m) as the workarounds mean that there are a lot of resources to come up - on slower/bigger clusters, we may end up getting close to the 5m limit. This is a one-release only thing though
1 parent d30327f commit 50623fb

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

install/kots/manifests/gitpod-installer-job.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
containers:
4040
- name: installer
4141
# This will normally be the release tag
42-
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-conditional-psp-removal.4"
42+
image: "eu.gcr.io/gitpod-core-dev/build/installer:release-2022.08.0.0"
4343
volumeMounts:
4444
- mountPath: /config-patch
4545
name: config-patch
@@ -301,6 +301,10 @@ spec:
301301
302302
# Apply the customization property - if something else is set, this will be ignored
303303
yq e -i ".customization = $(echo "${CUSTOMIZATION}" | base64 -d | yq e -o json '.customization' - | jq -rc) // []" "${CONFIG_FILE}"
304+
305+
# Delete any old resources
306+
echo "Gitpod: Deleting old Gitpod resources"
307+
kubectl delete all -n {{repl Namespace }} -l app=gitpod,component!=gitpod-installer,component!=gitpod-installer-status --wait || true
304308
fi
305309
else
306310
echo "Gitpod: No advanced configuration applied"
@@ -369,9 +373,23 @@ spec:
369373
echo "Gitpod: Escape any Golang template values"
370374
sed -i -r 's/(.*\{\{.*)/{{`\1`}}/' "${GITPOD_OBJECTS}/templates/gitpod.yaml"
371375
376+
# This is to overcome upgrade problems with PodSecurityPolicy removal
377+
echo "Gitpod: Delete Minio deployment"
378+
kubectl delete deployments.apps --wait -n {{repl Namespace }} minio || true
379+
380+
echo "Gitpod: Delete RabbitMQ statefulset"
381+
kubectl delete statefulsets.apps --wait -n {{repl Namespace }} messagebus || true
382+
383+
echo "Gitpod: Delete MySQL statefulset"
384+
kubectl delete statefulsets.apps --wait -n {{repl Namespace }} mysql || true
385+
386+
echo "Gitpod: Delete container-registry secret"
387+
kubectl delete secret --wait -n {{repl Namespace }} container-registry || true
388+
# End of PSP removal fixes
389+
372390
# If certificate secret already exists, set the timeout to 5m
373391
CERT_SECRET=$(kubectl get secrets -n {{repl Namespace }} https-certificates -o jsonpath='{.metadata.name}' || echo '')
374-
HELM_TIMEOUT="5m"
392+
HELM_TIMEOUT="10m"
375393
if [ "${CERT_SECRET}" = "" ]; then
376394
HELM_TIMEOUT="1h"
377395
fi

0 commit comments

Comments
 (0)