Skip to content

Commit 86b5d8a

Browse files
Simon Emmsroboquat
Simon Emms
authored andcommitted
[kots]: convert Installer job to use Helm
This allows for automatic deletion of resources that are no longer used
1 parent d10a3d0 commit 86b5d8a

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
containers:
4444
- name: installer
4545
# This will normally be the release tag - using this tag as need the license evaluator
46-
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-licensing.24'
46+
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-helm.7'
4747
volumeMounts:
4848
- mountPath: /config-patch
4949
name: config-patch
@@ -182,16 +182,39 @@ spec:
182182
config=$(cat "${CONFIG_FILE}")
183183
echo "Gitpod: ${CONFIG_FILE}=${config}"
184184
185-
/app/installer render -c "${CONFIG_FILE}" --namespace {{repl Namespace }} > /tmp/gitpod.yaml
185+
echo "Gitpod: Create a Helm template directory"
186+
rm -Rf "${GITPOD_OBJECTS}"
187+
mkdir -p "${GITPOD_OBJECTS}/templates"
188+
cat <<EOF >> "${GITPOD_OBJECTS}/Chart.yaml"
189+
apiVersion: v2
190+
name: gitpod-kots
191+
description: Always ready-to-code
192+
Version: "1.0.0"
193+
appVersion: "$(/app/installer version | yq e '.version' -)"
194+
EOF
195+
196+
/app/installer render -c "${CONFIG_FILE}" --namespace {{repl Namespace }} > "${GITPOD_OBJECTS}/templates/gitpod.yaml"
186197
187198
# Workaround for #8532 and #8529
188199
echo "Gitpod: Remove the StatefulSet status object for OpenVSX Proxy"
189200
yq eval-all --inplace \
190201
'del(select(.kind == "StatefulSet" and .metadata.name == "openvsx-proxy").status)' \
191-
/tmp/gitpod.yaml
202+
"${GITPOD_OBJECTS}/templates/gitpod.yaml"
192203
204+
# The long timeout is to ensure the TLS cert is created (if required)
193205
echo "Gitpod: Apply the Kubernetes objects"
194-
kubectl apply -f /tmp/gitpod.yaml
206+
helm upgrade \
207+
--atomic \
208+
--cleanup-on-fail \
209+
--create-namespace \
210+
--install \
211+
--namespace="{{repl Namespace }}" \
212+
--reset-values \
213+
--timeout 1h \
214+
--wait \
215+
--wait-for-jobs \
216+
gitpod \
217+
"${GITPOD_OBJECTS}"
195218
196219
echo "Gitpod: Installer job finished - goodbye"
197220
volumes:

0 commit comments

Comments
 (0)