This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A single community Helm chart (charts/redash) that deploys Redash on Kubernetes. There is no application code here — everything is Helm templates, values, and generated docs. Upstream is github.com/getredash/contrib-helm-chart; the published repo index lives on the gh-pages branch.
Dependencies must be fetched before helm template/install will work (helm lint only warns):
helm repo add bitnami https://charts.bitnami.com/bitnami
cd charts/redash && helm dependency build .helm lint charts/redash # required to pass by CONTRIBUTING
helm template test charts/redash # renders fine with stock values.yamlNothing gates rendering with default values — values.yaml ships placeholder redash.secretKey: test / cookieSecret: test, and the required guard in NOTES.txt is effectively defanged (its or chain falls through to the empty externalPostgreSQLSecret dict, and required only rejects nil and the empty string, so {} passes). Values are required for a working install, not for rendering. The canonical minimal working value set is the test-values.yaml heredoc in .github/workflows/ci.yml.
Full functional test = the minikube flow in .github/workflows/ci.yml (install → helm test → delete → reinstall → upgrade → helm test, across four Kubernetes minor versions). To reproduce one iteration locally you need a cluster; then follow that same sequence.
Regenerating the chart README (see the trap below):
cd charts/redash && helm-docs --dry-run | prettier --parser markdown > README.mdcharts/redash/README.md is produced from charts/redash/README.md.gotmpl plus the # key -- description comments in values.yaml. Edit the source, then regenerate.
Two traps:
- The pre-commit hook is wrong for the current layout.
.pre-commit-config.yamlrunshelm-docs --dry-run > README.mdfrom the repo root, but the chart moved out of the top level, so that writes the root README rather thancharts/redash/README.md. Run helm-docs from insidecharts/redash. - Regenerate from
charts/redash, and check the diff. The README had drifted from the template before (a stale version line, plus value rows for thepostgresqlMigrationblock 4.0.0 removed), because the hook above was writing to the wrong file. Content hand-added to the generated README is silently lost on the next regeneration — the### From 3.1 to 3.2upgrade notes had to be moved intoREADME.md.gotmplto survive.
The root README.md deliberately uses absolute GitHub URLs because it is synced to gh-pages. templates/ is in .prettierignore.
charts/redash/Chart.yaml version must be bumped in every change that should be published — the chart-releaser job only runs on pushes to master and only publishes versions it hasn't seen (commit a56f7a8 exists purely to bump the version and trigger it). Chart version is independent of appVersion (the Redash release); it follows semver on its own. Breaking changes go in CHANGELOG.md and in the "Upgrading" section of README.md.gotmpl.
Five workloads render from one shared env helper:
server-deployment.yaml— the web server, fronted byservice.yaml/ optionalingress.yaml.worker-deployment.yaml— one Deployment per key underworkers.*(adhoc,scheduled,generic), produced by a singlerange. Each worker's config ismergeOverwrite (deepCopy .Values.worker) $config, soworker.*holds shared defaults andworkers.<name>.*overrides them. Adding a worker means adding a values key, not a template.scheduler-deployment.yaml—strategy: Recreate, single instance.hook-migrations-job.yaml— apost-install,post-upgradehook Job runningcreate_db; this is how schema migrations happen.tests/test-connection.yaml— thehelm testpod, curls the service and greps for "Welcome to Redash".
An ~80-entry block mapping redash.* values to REDASH_* env vars, shared by every component. Key points:
- The block is delimited by
## Start primary Redash configuration/## End primary Redash configurationmarkers that mirror the same markers invalues.yamlandsecrets.yaml. Keep the three in sync. CONTRIBUTING.mdsays to regenerate this withpython scripts/update-env-config.py— that script no longer exists in the repo. Adding a Redash setting today means hand-editingvalues.yaml(with its helm-docs comment) and_helpers.tpl, plussecrets.yamlif the value is a secret.- Secret-valued settings are additionally gated on
redash.selfManagedSecretsandredash.existingSecret; follow the existing{{- if not .Values.redash.selfManagedSecrets }}pattern rather than inventing a new one. - Per-component env reaches the shared helper via
$envCtx := mergeOverwrite (deepCopy .) (dict "Values" (dict "env" .Values.<component>.env))— the helper always reads.Values.env, and each template swaps in its own component env before including it.
When the bundled postgresql / redis subcharts are enabled, REDASH_DATABASE_URL and REDASH_REDIS_URL are assembled from their component parts by an inline /bin/sh -c block in the container args. That identical snippet appears in server, worker, scheduler, and migrations templates. Any change to connection handling must be applied to all four.
Chart.yamlisapiVersion: v1with a separaterequirements.yaml/requirements.lock. This is the legacy Helm 2 layout but still supported and intentional — don't "modernize" it toapiVersion: v2with inlinedependencieswithout a deliberate decision.- Subchart versions use caret ranges (
^18.2.0), sorequirements.lockdrifts fromrequirements.yaml; regenerate the lock withhelm dependency update. - There is no
values.schema.json. What validation exists isrequiredcalls inside templates (secrets.yaml,NOTES.txt). redash.fullnametruncates at 43 chars, not the usual 63, to leave room for the component suffixes appended byredash.worker.fullnameand friends.extraObjects(rendered byextra-manifests.yaml) accepts raw manifests as strings or maps and runs them throughtpl, so entries may contain Helm template syntax.