Skip to content

Commit c988742

Browse files
author
Simon Emms
committed
[kots]: delete workspace pods before installing Gitpod
1 parent efce38b commit c988742

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

install/installer/scripts/kots-install.sh

+11
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ EOF
156156
HELM_TIMEOUT="1h"
157157
fi
158158

159+
echo "Gitpod: shut down any running workspaces/image-builders"
160+
161+
# gpctl doesn't have a namespace flag
162+
kubectl config set-context --current --namespace="${NAMESPACE}"
163+
164+
# Get list of workspace instances from gpctl
165+
for instance in $(gpctl workspaces list -o json | jq -r 'select(. != null) | .[] | .Instance'); do
166+
echo "Gitpod: shutting down workspace ${instance}"
167+
gpctl workspaces stop "${instance}"
168+
done
169+
159170
# The long timeout is to ensure the TLS cert is created (if required)
160171
echo "Gitpod: Apply the Kubernetes objects with timeout of ${HELM_TIMEOUT}"
161172
helm upgrade \

install/kots/manifests/gitpod-installation-status.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
containers:
3131
- name: installation-status
3232
# This will normally be the release tag
33-
image: "eu.gcr.io/gitpod-core-dev/build/installer:tar-installer-env-refactor.2"
33+
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-installer-kill-workspaces.5"
3434
envFrom:
3535
- configMapRef:
3636
name: gitpod-kots-config

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

+1-1
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:tar-installer-env-refactor.2"
42+
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-installer-kill-workspaces.5"
4343
volumeMounts:
4444
- mountPath: /mnt/node0
4545
name: node-fs0

install/kots/manifests/kots-preflight.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ spec:
1313
namespace: '{{repl Namespace }}'
1414
podSpec:
1515
containers: []
16+
- clusterResources:
17+
namespaces:
18+
- '{{repl Namespace }}'
1619
- run:
1720
collectorName: database
1821
image: eu.gcr.io/gitpod-core-dev/build/kots-config-check/database:sje-kots-config-check.9
@@ -429,3 +432,14 @@ spec:
429432
message: Registry is accessible
430433
- fail:
431434
message: Registry is inaccessible. Please check your network and firewall settings
435+
- textAnalyze:
436+
checkName: Check running workspaces
437+
fileName: cluster-resources/pods/{{repl Namespace }}.json
438+
regex: '"component": "workspace"'
439+
outcomes:
440+
- pass:
441+
when: "false"
442+
message: No running workspaces. Any workspaces started during the deployment process will be stopped.
443+
- fail:
444+
when: "true"
445+
message: There are running workspaces. These will be stopped during the deployment process.

0 commit comments

Comments
 (0)