Skip to content

[kots]: use Helm for the Installer job #8491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions install/installer/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See License-AGPL.txt in the project root for license information.

FROM alpine:3.15
COPY --from=alpine/helm:3.8.0 /usr/bin/helm /usr/bin/helm
COPY install-installer--app/installer install-installer--app/provenance-bundle.jsonl /app/
RUN apk add --no-cache curl yq \
&& curl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl \
Expand Down
31 changes: 27 additions & 4 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:sje-licensing.24'
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-helm.7'
volumeMounts:
- mountPath: /config-patch
name: config-patch
Expand Down Expand Up @@ -182,16 +182,39 @@ spec:
config=$(cat "${CONFIG_FILE}")
echo "Gitpod: ${CONFIG_FILE}=${config}"

/app/installer render -c "${CONFIG_FILE}" --namespace {{repl Namespace }} > /tmp/gitpod.yaml
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"

# Workaround for #8532 and #8529
echo "Gitpod: Remove the StatefulSet status object for OpenVSX Proxy"
yq eval-all --inplace \
'del(select(.kind == "StatefulSet" and .metadata.name == "openvsx-proxy").status)' \
/tmp/gitpod.yaml
"${GITPOD_OBJECTS}/templates/gitpod.yaml"

# The long timeout is to ensure the TLS cert is created (if required)
echo "Gitpod: Apply the Kubernetes objects"
kubectl apply -f /tmp/gitpod.yaml
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