diff --git a/.werft/jobs/build/build-and-publish.ts b/.werft/jobs/build/build-and-publish.ts index 954ca91e310a54..1d656cefe6abb8 100644 --- a/.werft/jobs/build/build-and-publish.ts +++ b/.werft/jobs/build/build-and-publish.ts @@ -111,6 +111,7 @@ function publishKots(werft: Werft, jobConfig: JobConfig) { // Set the tag to the current version exec(`yq w -i ${REPLICATED_YAML_DIR}/gitpod-installer-job.yaml ${INSTALLER_JOB_IMAGE} ${image}:${jobConfig.version}`, { slice: phases.PUBLISH_KOTS }); + exec(`yq w -i ${REPLICATED_YAML_DIR}/gitpod-installation-status.yaml ${INSTALLER_JOB_IMAGE} ${image}:${jobConfig.version}`, { slice: phases.PUBLISH_KOTS }); // Generate the logo exec(`make logo -C ${REPLICATED_DIR}`, { slice: phases.PUBLISH_KOTS }); diff --git a/install/installer/leeway.Dockerfile b/install/installer/leeway.Dockerfile index 979615ae0fadbb..3b54157a119ca2 100644 --- a/install/installer/leeway.Dockerfile +++ b/install/installer/leeway.Dockerfile @@ -5,7 +5,7 @@ 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 \ +RUN apk add --no-cache curl jq 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 \ && chmod +x /usr/local/bin/kubectl ENTRYPOINT [ "/app/installer" ] diff --git a/install/kots/manifests/gitpod-installation-status.yaml b/install/kots/manifests/gitpod-installation-status.yaml new file mode 100644 index 00000000000000..6f80047dfeb4df --- /dev/null +++ b/install/kots/manifests/gitpod-installation-status.yaml @@ -0,0 +1,57 @@ +# Copyright (c) 2022 Gitpod GmbH. All rights reserved. +# Licensed under the MIT License. See License-MIT.txt in the project root for license information. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: installation-status + labels: + app: gitpod + component: gitpod-installer-status +spec: + replicas: 1 + selector: + matchLabels: + app: gitpod + component: gitpod-installer-status + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + labels: + app: gitpod + component: gitpod-installer-status + spec: + restartPolicy: Always + serviceAccountName: installer + containers: + - name: installation-status + # This will normally be the release tag + image: "eu.gcr.io/gitpod-core-dev/build/installer:main.2968" + command: + - /bin/sh + - -c + args: + - | + set -e + + while true + do + echo "Checking installation status" + + if [ "$(helm status -n {{repl Namespace }} gitpod -o json | jq '.info.status == "deployed"')" != "true" ]; + then + echo "Gitpod: Installation not complete" + exit 1 + fi + + echo "Sleeping for 10 seconds" + sleep 10 + done + resources: + limits: + memory: "128Mi" + cpu: "500m" diff --git a/install/kots/manifests/gitpod-installer-job.yaml b/install/kots/manifests/gitpod-installer-job.yaml index 0bf0dcf1c96cb7..0332c50ac4ea21 100644 --- a/install/kots/manifests/gitpod-installer-job.yaml +++ b/install/kots/manifests/gitpod-installer-job.yaml @@ -23,8 +23,8 @@ spec: restartPolicy: OnFailure 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-airgapped.0' + # This will normally be the release tag + image: 'eu.gcr.io/gitpod-core-dev/build/installer:main.2968' volumeMounts: - mountPath: /config-patch name: config-patch @@ -212,6 +212,9 @@ spec: gitpod \ "${GITPOD_OBJECTS}" + echo "Gitpod: Restarting installation status job" + kubectl delete pod -n {{repl Namespace }} -l component=gitpod-installer-status || true + echo "Gitpod: Installer job finished - goodbye" volumes: - name: config-patch diff --git a/install/kots/manifests/kots-app.yaml b/install/kots/manifests/kots-app.yaml index cf5ce8e2099fe3..0d2674e2d5c530 100644 --- a/install/kots/manifests/kots-app.yaml +++ b/install/kots/manifests/kots-app.yaml @@ -17,6 +17,7 @@ spec: - deployment/dashboard - deployment/ide-proxy - deployment/image-builder-mk3 + - deployment/installation-status - deployment/proxy - deployment/server - deployment/ws-manager