Skip to content

Commit

Permalink
[kots]: convert Installer job to use Helm
Browse files Browse the repository at this point in the history
This allows for automatic deletion of resources that are no longer
used
  • Loading branch information
Simon Emms committed Mar 2, 2022
1 parent 841bea3 commit 406678c
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions install/kots/manifests/gitpod-installer-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
containers:
- name: installer
# This will normally be the release tag - using this tag as need the license evaluator
image: 'eu.gcr.io/gitpod-core-dev/build/installer:main.2569'
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-helm.4'
volumeMounts:
- mountPath: /config-patch
name: config-patch
Expand Down Expand Up @@ -182,7 +182,32 @@ spec:
config=$(cat "${CONFIG_FILE}")
echo "Gitpod: ${CONFIG_FILE}=${config}"
/app/installer render -c "${CONFIG_FILE}" --namespace {{repl Namespace }} | kubectl apply -f -
echo "Gitpod: Create a Helm template directory"
rm -Rf "${GITPOD_OBJECTS}"
mkdir -p "${GITPOD_OBJECTS}/templates"
cat <<EOF >> "${GITPOD_OBJECTS}/Chart.yaml"
apiVersion: v2
name: gitpod-kots
description: Always ready-to-code
Version: "1.0.0"
appVersion: "$(/app/installer version | yq e '.version' -)"
EOF
/app/installer render -c "${CONFIG_FILE}" --namespace {{repl Namespace }} > "${GITPOD_OBJECTS}/templates/gitpod.yaml"
# The long timeout is to ensure the TLS cert is created (if required)
helm upgrade \
--atomic \
--cleanup-on-fail \
--create-namespace \
--install \
--namespace="{{repl Namespace }}" \
--reset-values \
--timeout 1h \
--wait \
--wait-for-jobs \
gitpod \
"${GITPOD_OBJECTS}"
echo "Gitpod: Installer job finished - goodbye"
volumes:
Expand Down

0 comments on commit 406678c

Please sign in to comment.