Skip to content

feat: publish helm chart to helm.coder.com #4793

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 4 commits into from
Nov 4, 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
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down Expand Up @@ -167,6 +169,26 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Authenticate to Google Cloud
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: |
set -euo pipefail
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 }}
uses: actions/upload-artifact@v2
Expand Down
20 changes: 10 additions & 10 deletions docs/install/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<release>/coder_helm_<release>.tgz
helm repo add coder-v2 https://helm.coder.com/v2
```

1. Create a secret with the database URL:
Expand Down Expand Up @@ -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-v2/coder \
--namespace coder \
--values values.yaml
```
Expand All @@ -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-v2/coder \
--namespace coder \
-f values.yaml
```

## Troubleshooting
Expand Down