The shared jlab-renovate-bot instance serves this repo and cluster-config,
and two repos behaving differently under one bot is a source of surprises
rather than of safety. This adopts cluster-config's configuration:
config:best-practices in extends, labels ["renovate"], no PR caps
(prHourlyLimit 0, prConcurrentLimit 100), separateMinorPatch, an explicit
dependencyDashboard, and global automerge with platformAutomerge.
Two of those choices were previously wrong here and are now right, because
the branch protection on main has caught up: a review requirement and
validate-charts as a required check are both active. platformAutomerge
therefore arms the PR on the forge and Gitea merges it when the check
passes AND the review exists - the review is the gate, which is what makes
automerging majors something other than unattended merging.
Comments that asserted the opposite are rewritten rather than left to rot:
the platformAutomerge: false comment ("not (yet) a required check on either
side"), the "Majors stay manual" rule, the README PR policy bullets and the
required-check paragraph, and the CLAUDE.md forge notes.
config:best-practices pulls in docker:pinDigests, which is switched off
again for custom.regex and helm-values: an appVersion: is a tag by
construction and has nowhere to put a digest. Kept deliberately:
minimumReleaseAge of three days on the routine updates (every merge here
publishes a chart), the ignorePaths and ci/** opt-outs, every per-chart
manager, the nginx and qbittorrent constraints, and postUpgradeTasks.
Fixes #34
15 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Working on issues — mandatory workflow
The main Claude session acts as the task manager and does not implement issues itself:
- Plan first, get approval: The manager presents a plan for the issue and waits for the user's explicit approval. No implementation before approval.
- Document the final plan on the issue: Once approved, the plan is posted as a comment on the issue before implementation starts (skip if the issue body already contains the full plan; later decisions go there as comments too).
- Delegate implementation: After approval, the manager launches a dedicated development agent. The agent implements the issue completely on its own branch and opens a PR.
- PR comment handling by the agent: After opening the PR, the development agent watches it for review comments. New comments are addressed automatically (code changes, reply on the thread), and addressed threads are marked as resolved.
- Update the wiki — mandatory, and before the merge is requested. The wiki is this repo's knowledge base; a change that lands in
mainwhile the wiki still describes the old state has not been finished, it has been half-finished in a way nothing fails on. The development agent edits the affected pages as part of its issue, so code and documentation are reviewed together. See "The wiki" below for what obliges an edit and what does not. - Agent lifetime: The development agent terminates itself once its PR has been merged (or closed).
- Only after the PR has been merged by the user may work on the next issue begin. The user merges; never merge yourself.
- After the merge, verify the linked issue was closed (auto-close via "Fixes #n"); close it manually if not. Gitea auto-closes on the same keywords, but only for an issue in the same repository — a migrated issue whose number changed is closed by hand. Check in the same step that the wiki edit really landed.
Additional rules for all commits, PRs, issues, and comments:
- Do not add a
Co-Authored-Bytrailer and do not append "Generated with Claude Code" footers. - Commits must be signed, and in the Coder workspace they are: signing runs through its own SSH signer (
gpg.format = ssh,gpg.ssh.program = coder-git-ssh-sign,commit.gpgsign = true), so no 1Password step is involved. Verify before opening the PR —git log --format='%G?' -1must printG— and if signing fails, stop and report rather than pushing unsigned work, because branch protection rejects it at merge time.
The wiki
The knowledge base is the Gitea wiki at https://git.jk-dev.de/jlab-cluster/helm-charts/wiki — one page per chart (installation, required 1Password fields, every configurable value, the chart's traps) plus the long form of this workflow, the pipelines, the style guide and the incidents each rule was bought with. It is a separate git repository:
git clone ssh://git@git.jk-dev.de:30022/jlab-cluster/helm-charts.wiki.git
Flat layout, one Markdown file per page, page name = file name, links are relative page names without the extension ([CI/CD](CI-CD)). A new page must also be listed in _Sidebar.md, or it is reachable only by search.
What obliges a wiki edit (step 7 of the workflow above, same round of work, never a follow-up issue):
| Change | Page |
|---|---|
| a value added, removed, renamed, or its default changed | the chart's page — values table, and the operating notes if behaviour moved |
| runtime behaviour changed (probes, hardening, restart semantics, a value becoming required) | the chart's page, plus Lessons-Learned if the reason could be repeated elsewhere |
| a new chart | a new chart page, a row in Charts, an entry in _Sidebar.md |
| a convention added or changed | Chart-Style-Guide (and README, which stays the code-side copy) |
| pipeline, fixture or runner behaviour changed | CI-CD |
| this issue workflow changed | Workflow — and this file, which is the binding copy |
| a Renovate rule added or changed | Renovate |
| something broke in a way a rule now prevents | Lessons-Learned |
What does not oblige an edit: a plain app-version bump. Renovate automerges those continuously and never touches the wiki, which is why chart pages quote versions as snapshots and name Chart.yaml as the source of truth. An app update that does change values or behaviour is not a plain bump, and the table applies.
Wiki commits follow the same rules as repo commits: no Co-Authored-By, no "Generated with Claude Code" footer.
Which forge, and with which tool
Everything runs on the Gitea instance JLab-Git: issues, pull requests, CI and Renovate. github.com is a push mirror with Actions and Renovate switched off, and it lags until the mirror runs. README, "Where this repo lives", holds the measured differences between a Gitea runner and a GitHub one.
tea, notgh. Work happens in a Coder workspace, and it has noop— that is the normal case here, not a broken environment, so do not wait for the 1Password CLI or propose installing it. Callteadirectly; it carries the workspace's stored login and opens PRs and issues under the bot account, which is accepted. Say so in the report when something is authored that way. (op plugin run -- tea, the older instruction, applies only whereopactually exists.)- Remotes are named
githubandJLab-Git— there is noorigin.JLab-Git/mainis the leading copy; say which remote you mean, becausegit pushwithout one is ambiguous here. - Branch protection with a signature requirement is active, and signatures verify on Gitea. A commit that is not signed does not reach
main— check before opening a PR, do not discover it at merge time. - No merge queue. Gitea has none, and its place is taken by auto-merge on green checks: the PR is armed once and merges itself when the required check passes and the required review exists — both are active on
main, so an armed PR without a review sits there instead of merging. Rule 6 above is unchanged — the user merges, and an agent never merges its own PR or arms auto-merge on it. - A required check per chart is not possible. Gitea runs a whole matrix as one job under one status context, so the install-test reports once for all charts. What is required on
mainisvalidate-charts, as that single context; per chart is the part that cannot be had. Relevant whenever branch protection is touched. - Issue numbers changed with the move, and
#nin this repo's files means the GitHub tracker. The issues open at the time are Gitea #5–#21 and #24; the mapping is a comment on Gitea #14. Closed ones were not migrated and exist only on GitHub. Beware that Gitea silently resolves a bare#nagainst its own counter, so an old reference can render as a link to something unrelated. When you write a new reference, use the Gitea number. - Renovate runs outside this repo, as the shared
jlab-renovate-botinstance; it reads ourrenovate.json5and itspostUpgradeTaskshook is allow-listed there. Do not add a Renovate workflow here — a second runner means duplicate PRs and two schedulers rewriting each other's branches. README, "Renovate on Gitea", has the evidence.
Keep the docs current
- Changes to this issue workflow always go into this CLAUDE.md file.
- General repository information (charts, CI pipelines, conventions, tooling) always lives in README.md. Any PR that changes repo-wide behavior must update README.md in the same PR.
- Operator-facing knowledge lives in the wiki, not in README.md: how a chart is installed, what every value does, what its traps are. The division is
CLAUDE.mdbinds the agent,README.mdexplains the repository to someone reading the code, the wiki explains the system to whoever runs it, and a chart'sNOTES.txtexplains one release. Where README and the wiki cover the same rule, both are updated in the same PR — see "The wiki" above. - Runtime verification of chart changes is done in a local, throwaway k3d cluster (k3d is installed on the maintainer's machine): stub CRD for
OnePasswordItem, dummy secrets, throwaway infrastructure (postgres/redis) where needed.
What this repo is
A collection of self-made Helm charts, one directory per chart, published to a private, classic (index-based) Helm registry by Gitea Actions — an HTTP POST of the packaged .tgz, not an OCI helm push; the target URL and its credentials live in 1Password and never in this repository. Validation happens on three levels: locally with Helm, in the PR pipeline (validate-charts.yml: strict lint, package, version-bump check), and in the PR install-test stage (k3d, fixtures under ci/ — see README):
helm lint --strict <chart-name>
helm template <chart-name> --set ingress.domain=example.com --set ingress.clusterIssuer=letsencrypt # render locally; required values vary per chart
Creating a new chart
Copy template-chart/ and replace every xxx placeholder — in file names (templates/xxx.deployment.yaml → templates/<app>.deployment.yaml), in Chart.yaml, in the values.yaml keys and their .Values.xxx.* references inside templates, and in values.schema.json (both the values paths and the xxx. helper prefixes). The schema and the null-safe fallback helpers come with the template but their content is chart-specific — adapt them along the six points of the README section "Values that must not lie", and validate the result against the chart's real bundle values, not only against its defaults. Then wire up CI:
- Add
.github/workflows/publish-<chart-name>.yml(copy an existing one, e.g.publish-outline.yml) — it triggers on pushes tomaintouching<chart-name>/**and calls the reusablepublish-helm-chart.yml. - Add the chart name to the
chart-namechoice list in.github/workflows/change-app-version.yml. - Add install-test fixtures under
ci/<chart-name>/(test-values.yaml,fixtures.yaml) or an entry with justification inci/excluded-charts.txt— the PR install-test fails if both are missing. - Add a
customManagersblock for the chart's main image inrenovate.json5(one per chart, since the image repository lives in the template and the version inChart.yaml) — without it Renovate never updates that chart's app version. See README section "Dependency updates (Renovate)".
Versioning scheme
Chart.yaml versions follow version: <chart-semver>+up<appVersion> (e.g. 1.4.0+up1.9.2), with appVersion matching the suffix (dashes in the app version are normalized to dots in the suffix). Any push to main touching a chart directory publishes that chart, so the version must be bumped in the same change.
Semver conventions for the chart part:
- Patch: bug fixes without behavior or values-schema change; plain app-version updates.
- Minor: additive, backward-compatible changes (new optional values with unchanged defaults).
- Major: runtime behavior changes or breaking values changes (e.g. probes, security hardening, computed limits, values that become required).
App-version updates go through PRs (so the validate and install-test pipelines run), not through the change-app-version.yml dispatch workflow (which commits directly to main and bypasses both). For app major jumps, update stepwise: first to the last release of the old major line (own PR, merge, publish), then to the newest major.
Chart conventions
The binding style guide for all current and future charts lives in README.md ("Chart style guidelines"); template-chart/ is the reference implementation. Compact summary:
- Resources named
{{ .Release.Name }}-{{ .Chart.Name }}-<kind>; template files<app>.<kind>.yaml; stateful apps use a StatefulSet (<app>.sfs.yaml). Documented exception: historical PVC names stay (renames would orphan data); StatefulSet renames only with a--cascade=orphanmigration note in a major PR. - Main image tag from
{{ .Chart.AppVersion }}; auxiliary/sidecar/init images pinned via values and reviewed on app-update rounds. - Ingress:
ingress.domainandingress.clusterIssuerrequiredwithout defaults;ingress.classNamedefaults tonginx; optionalingress.annotationsmerged with the cert-manager annotation; TLS secrettls-<release>-<chart>-ingress. Documented exception: homeassistant keeps its flexible upstream ingress style (className defaultnginx). - Secrets are 1Password
OnePasswordItemCRs: values exposesecrets.<name>SecretRefholding anop://item path; the operator materializes the Kubernetes Secret. - Config changes must restart the workload (#82): every pod template consuming a ConfigMap carries
checksum/config: {{ include (print $.Template.BasePath "/<chart>.configmap.yaml") . | sha256sum }}(one line per ConfigMap). Without it a changed ConfigMap restarts nothing —subPathmounts are never refreshed and apps read config only at start. Adding it to an existing chart is a major bump. Secrets fromOnePasswordItemcannot be hashed (Helm never sees their content); charts mounting them document the limitation invalues.yaml. - Every container offers an additive
envblock rendered throughtplwithvalue,secretKeyRef, andconfigMapKeyRefforms. - Hardening:
automountServiceAccountToken: false, non-root,readOnlyRootFilesystem: true, caps dropped,allowPrivilegeEscalation: false; contexts values-configurable (securityContext.pod/securityContext.container); writable paths as emptyDirs; image-forced deviations MUST be documented with a comment in the chart'svalues.yaml. - Probes: liveness/readiness/startup on every workload (exception: paperless consume CronJob), values-configurable with calibrated defaults.
- Resources: requests as values defaults; limits auto-computed by the
_helpers.tplhelper (limitFactordefault 3; no CPU limits unless set explicitly). - Replicas per workload (explicit
0allowed) plus a chart-globalscaleDownflag that overrides them. icon:mandatory in everyChart.yaml;helm lint --strictwithout findings; CI fixtures underci/<chart>/or a justified exclusion.- Chart dependencies are admissible but expensive (the former "no dependencies" rule fell with #214;
ytdlp-web-playeris the only chart using one). A dependency has to be optional and off by default viacondition:, and upstream's chart is consumed as it comes — where its defaults fall short of these conventions, that is documented in ourvalues.yaml, never patched. The price to know before adding the next one: a subchart is invisible to everything downstream that watches Helm release versions, so a new upstream version — a security fix included — reaches a cluster only when the outer chart is republished (Renovate's built-inhelmv3manager plusci/renovate-bump-chart.shis the whole safety net, and it belongs in a comment at the pinned version); and every helm command exits 1 whilecharts/is unfilled, which is whyci/helm-dependencies.shruns before lint, package, render and install — including the render test that covers all charts on every PR. Full rules and the rest of the cost: README, "Chart dependencies".