From 5f84ee923f2df37dcf2ee10194c53b267ea2f750 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Thu, 27 Oct 2022 21:41:40 +0000 Subject: [PATCH 1/4] feat: publish helm chart to helm.coder.com --- .github/workflows/release.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a209df4343592..cecf9f367461b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,8 @@ permissions: contents: write # Necessary to push docker images to ghcr.io. packages: write + # Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage) + id-token: write env: CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }} @@ -166,6 +168,23 @@ jobs: ./build/*.rpm env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Authenticate to Google Cloud + id: auth + uses: google-github-actions/auth@v0 + with: + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - name: Setup GCloud SDK + uses: 'google-github-actions/setup-gcloud@v0' + - name: Publish Helm Chart + run: | + version="$(./scripts/version.sh)" + mkdir -p build/helm + cp "build/coder_helm_${version}.tgz" build/helm + gsutil cp gs://helm.coder.com/v2/index.yaml build/helm/index.yaml + helm repo index build/helm --url https://helm.coder.com/v2 --merge build/helm/index.yaml + gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/coder_helm_${version}.tgz gs://helm.coder.com/v2 + gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/v2 - name: Upload artifacts to actions (if dry-run or snapshot) if: ${{ github.event.inputs.dry_run || github.event.inputs.snapshot }} From aabbd0a6f7933631e7a0fc04b4f3b779718354fd Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Fri, 28 Oct 2022 00:19:58 +0000 Subject: [PATCH 2/4] newlines --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cecf9f367461b..431f4f16bda2d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -168,14 +168,17 @@ jobs: ./build/*.rpm env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Authenticate to Google Cloud id: auth uses: google-github-actions/auth@v0 with: workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }} service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - name: Setup GCloud SDK uses: 'google-github-actions/setup-gcloud@v0' + - name: Publish Helm Chart run: | version="$(./scripts/version.sh)" From d3810677a0efff038f399404e82dd3f715e7f48d Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Fri, 28 Oct 2022 00:39:00 +0000 Subject: [PATCH 3/4] update docs --- docs/install/kubernetes.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/install/kubernetes.md b/docs/install/kubernetes.md index 81958e964878c..ca60f98d7194c 100644 --- a/docs/install/kubernetes.md +++ b/docs/install/kubernetes.md @@ -57,11 +57,10 @@ to log in and manage templates. [Postgres operator](https://github.com/zalando/postgres-operator) to manage PostgreSQL deployments on your Kubernetes cluster. -1. Download the latest `coder_helm` package from - [GitHub releases](https://github.com/coder/coder/releases). +1. Add the Coder Helm repo: ```console - wget https://github.com/coder/coder/releases/download//coder_helm_.tgz + helm repo add coder https://helm.coder.com/v2 ``` 1. Create a secret with the database URL: @@ -116,10 +115,10 @@ to log in and manage templates. > [values.yaml](https://github.com/coder/coder/blob/main/helm/values.yaml) > file directly. -1. Run the following commands to install the chart in your cluster. +1. Run the following command to install the chart in your cluster. ```sh - helm install coder ./coder_helm_x.y.z.tgz \ + helm install coder coder/coder \ --namespace coder \ --values values.yaml ``` @@ -139,12 +138,13 @@ to log in and manage templates. ## Upgrading Coder via Helm To upgrade Coder in the future or change values, -you can run the following command with a new `coder_helm_x.y.z.tgz` file from GitHub releases: +you can run the following command: -```console -$ helm upgrade coder ./coder_helm_x.y.z.tgz \ - --namespace coder \ - -f values.yaml +```sh +helm repo update +helm upgrade coder coder/coder \ + --namespace coder \ + -f values.yaml ``` ## Troubleshooting From 12f77e7b445e4400323675999d46bcb89dd496cc Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Fri, 4 Nov 2022 00:03:41 +0000 Subject: [PATCH 4/4] pr comments --- .github/workflows/release.yaml | 2 +- docs/install/kubernetes.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 431f4f16bda2d..82e8528eeaf74 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -170,7 +170,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Authenticate to Google Cloud - id: auth uses: google-github-actions/auth@v0 with: workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }} @@ -181,6 +180,7 @@ jobs: - name: Publish Helm Chart run: | + set -euo pipefail version="$(./scripts/version.sh)" mkdir -p build/helm cp "build/coder_helm_${version}.tgz" build/helm diff --git a/docs/install/kubernetes.md b/docs/install/kubernetes.md index ca60f98d7194c..90dbf92ebca93 100644 --- a/docs/install/kubernetes.md +++ b/docs/install/kubernetes.md @@ -60,7 +60,7 @@ to log in and manage templates. 1. Add the Coder Helm repo: ```console - helm repo add coder https://helm.coder.com/v2 + helm repo add coder-v2 https://helm.coder.com/v2 ``` 1. Create a secret with the database URL: @@ -118,7 +118,7 @@ to log in and manage templates. 1. Run the following command to install the chart in your cluster. ```sh - helm install coder coder/coder \ + helm install coder coder-v2/coder \ --namespace coder \ --values values.yaml ``` @@ -142,7 +142,7 @@ you can run the following command: ```sh helm repo update -helm upgrade coder coder/coder \ +helm upgrade coder coder-v2/coder \ --namespace coder \ -f values.yaml ```