Switches dogfood from push-based deploys to pull-based, digest-pinned deploys with Flux image automation (SEC-863): - **Remove the push deploy.** Deletes `deploy.yaml` and `scripts/should_deploy.sh`, and drops the `deploy` job from `build.yaml`. CI no longer assumes the AWS deploy role, fetches EKS credentials, runs `flux reconcile` or `kubectl rollout restart`, or retags `:dogfood`, which nothing consumes. `build.yaml` now has no cluster access, and only the signing job's existing `id-token: write` remains. - **`coder.image.digest`** in the `coder`, `provisioner` and `ai-gateway` charts. When set, the image renders as `repo:tag@digest`. Empty (the default) keeps today's output, and existing golden files are unchanged. - **Sortable main tag.** `build.yaml` pushes an extra `main-<commit unix time>-<12 char sha>` tag for every main build, which the Flux `ImagePolicy` orders on. The `prune` job already prunes `^main-` tags older than 30 days. Companion PR: coder/dogfood#857, which installs the image controllers and pins dogfood-cdr by digest. **Merge this one first**: the ai-gateway chart's schema rejects unknown keys, so dogfood's new `digest` value would fail on the current chart. Merging this before dogfood#857 doesn't regress anything. The `dogfood-coder-repo-ci` role's trust was disabled during containment, so the deploy job currently fails at OIDC role assumption on every main build and only sends a failure alert to Slack. Until dogfood#857 is live, dogfood stays on its current image. <details> <summary>Design notes and decision log</summary> - **Delete the deploy instead of keeping a Flux webhook ping.** A ping would only cut latency. Flux scans the registry every 2m, so any trigger can be added later as a notification-controller `Receiver` without giving CI cluster credentials. - **Separate digest value instead of `tag: x@sha256:...`.** Flux's `:tag` and `:digest` setters write separate fields, and no setter writes `tag@digest` into a single field. A dedicated chart value is the documented Flux pattern for HelmReleases and is useful to customers who pin by digest. - **Commit timestamp in the tag.** `git log -1 --format=%ct` makes the tag sort by commit time, which Flux's `numerical` policy selects on. The sha suffix keeps tags unique and traceable. - **Not done here:** - Making the cosign and GitHub attestation steps required. They're still `continue-on-error`. Admission-time signature verification is a separate SEC-863 step. - Removing the AWS role itself and the `AWS_DOGFOOD_*` repo variables. Those are settings outside the repo, and they become unused once this merges. </details> Verified: `go test ./helm/...`, `make lint/helm`, `make lint/actions`. I also rendered the dogfood-cdr values against this branch's charts, and the server, provisioner and ai-gateway images all come out as `ghcr.io/coder/coder-preview:<tag>@sha256:<digest>`. Refs SEC-863 > Generated by Coder Agents on behalf of @deansheather.
Coder Helm Chart
This directory contains the Helm chart used to deploy Coder provisioner daemons onto a Kubernetes cluster.
External provisioner daemons are a Premium feature. Contact sales@coder.com.
Getting Started
Warning
: The main branch in this repository does not represent the latest release of Coder. Please reference our installation docs for instructions on a tagged release.
View our docs for detailed installation instructions.
Values
Please refer to values.yaml for available Helm values and their defaults.
A good starting point for your values file is:
coder:
env:
- name: CODER_URL
value: "https://coder.example.com"
# This env enables the Prometheus metrics endpoint.
- name: CODER_PROMETHEUS_ADDRESS
value: "0.0.0.0:2112"
replicaCount: 10
provisionerDaemon:
keySecretName: "coder-provisionerd-key"
keySecretKey: "provisionerd-key"
Specific Examples
Below are some common specific use-cases when deploying a Coder provisioner.
Set Labels and Annotations
If you need to set deployment- or pod-level labels and annotations, set coder.{annotations,labels} or coder.{podAnnotations,podLabels}.
Example:
coder:
# ...
annotations:
com.coder/annotation/foo: bar
com.coder/annotation/baz: qux
labels:
com.coder/label/foo: bar
com.coder/label/baz: qux
podAnnotations:
com.coder/podAnnotation/foo: bar
com.coder/podAnnotation/baz: qux
podLabels:
com.coder/podLabel/foo: bar
com.coder/podLabel/baz: qux
Additional Templates
You can include extra Kubernetes manifests in extraTemplates.
The below example will also create a ConfigMap along with the Helm release:
coder:
# ...
provisionerDaemon:
# ...
extraTemplates:
- |
apiVersion: v1
kind: ConfigMap
metadata:
name: some-config
namespace: {{ .Release.Namespace }}
data:
key: some-value
Disable Service Account Creation
Deploying multiple provisioners in the same namespace
To deploy multiple provisioners in the same namespace, set the following values explicitly to avoid conflicts:
nameOverride: controls the name of the provisioner deploymentserviceAccount.name: controls the name of the service account.
Note that nameOverride does not apply to extraTemplates, as illustrated below:
coder:
# ...
serviceAccount:
name: other-coder-provisioner
provisionerDaemon:
# ...
nameOverride: "other-coder-provisioner"
extraTemplates:
- |
apiVersion: v1
kind: ConfigMap
metadata:
name: some-other-config
namespace: {{ .Release.Namespace }}
data:
key: some-other-value
If you wish to deploy a second provisioner that references an existing service account, you can do so as follows:
- Set
coder.serviceAccount.disableCreate=trueto disable service account creation, - Set
coder.serviceAccount.workspacePerms=falseto disable creation of a role and role binding, - Set
coder.serviceAccount.nameOverrideto the name of an existing service account.
See below for a concrete example:
coder:
# ...
serviceAccount:
name: preexisting-service-account
disableCreate: true
workspacePerms: false
provisionerDaemon:
# ...
nameOverride: "other-coder-provisioner"
Testing
The test suite for this chart lives in ./tests/chart_test.go.
Each test case runs helm template against the corresponding test_case.yaml, and compares the output with that of the corresponding test_case.golden in ./tests/testdata.
If expectedError is not empty for that specific test case, no corresponding .golden file is required.
To add a new test case:
- Create an appropriately named
.yamlfile intestdata/along with a corresponding.goldenfile, if required. - Add the test case to the array in
chart_test.go, settingnameto the name of the files you added previously (without the extension). If appropriate, setexpectedError. - Run the tests and ensure that no regressions in existing test cases occur:
go test ./tests.