helm-conventions
Skill7 starsChanged 3 days agoMITView on GitHub
Helm charts: values, security context, KSV, templates, helm-docs, resources. TRIGGER when: editing a chart's `templates/`, own values files, `Chart.yaml`, `.helmignore` or `README.md`; adding a Kubernetes object to a chart; user asks about Helm values, RBAC, security context, KSV findings or helm-docs. SKIP when: overriding another chart's values (`argocd-conventions`), or no chart file and no Helm question.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- leroyguillaume/skillsword for word, first seen Nov 22, 2026
Other versions1 project uses a version of this.
Word for word · 1
- leroyguillaume/skills★ 7100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- adr-conventionsSkill
- api-conventionsSkill
- architecture-conventionsSkill
- argocd-conventionsSkill
- ci-conventionsSkill
- config-conventionsSkill
- contributing-conventionsSkill
- councilSkill
- cryptography-conventionsSkill
- dependency-update-conventionsSkill
- diagram-conventionsSkill
- docker-conventionsSkill
- documentation-conventionsSkill
- frontend-conventionsSkill
- github-actions-conventionsSkill
- github-issue-conventionsSkill
- github-pr-conventionsSkill
- github-repo-settingsSkill
- gitlab-ci-conventionsSkill
- herdr-core-delegationSkill
- herdr-delegationSkill
- herdr-tui-delegationSkill
- kopf-conventionsSkill
- kubernetes-operator-conventionsSkill
- logging-conventionsSkill
- logo-conventionsSkill
- mise-conventionsSkill
- ollama-conventionsSkill
- openssf-conventionsSkill
- pr-conventionsSkill
- pre-commit-conventionsSkill
- project-metadata-conventionsSkill
- python-async-conventionsSkill
- python-conventionsSkill
- readme-conventionsSkill
- release-script-conventionsSkill
- release-supply-chain-conventionsSkill
- renovate-ci-conventionsSkill
- rest-conventionsSkill
- rust-build-conventionsSkill
- rust-conventionsSkill
- rust-http-conventionsSkill
- security-policy-conventionsSkill
- signal-handling-conventionsSkill
- sql-conventionsSkill
- starlight-conventionsSkill
- systemd-conventionsSkill
- system-user-conventionsSkill
- task-conventionsSkill
- terraform-conventionsSkill
- topic-splittingSkill
- ui-copy-conventionsSkill
- web-layout-conventionsSkill
- yaml-conventionsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 6 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 54
When a component renders two or more objects of the same Kind, nest those in a per-kind subdirectory …
- Distinctive: line 72
Never place one component's template under another component's directory.
- Distinctive: line 76
When a chart attaches a route to shared gateway infrastructure, create
- Very specific: line 180
Document every key in values.yaml with a helm-docs # -- annotation immediately above it — no value is allowed to ship undocumented, …
- Very specific: line 208
Add the norwoodj/helm-docs pre-commit hook (or a local hook invoking the installed helm-docs binary) to .pre-commit-config.yaml.
- Very specific: line 215
Add a helm lint hook in .pre-commit-config.yaml (local hook) that runs against every chart directory.
- Very specific: line 267
Only these two. Any other KSV-xxxx finding gets fixed, or raised with the user.
- Very specific: line 269
Always set resources.requests for CPU, memory, and ephemeral storage, and resources.limits for memory and ephemeral storage only.
- Distinctive: line 317
Never ship a chart that weakens the restricted security context.
- Very specific: line 318
Never add a values.yaml key without a # -- comment, or a ~/{}/[] default without its (<type>) hint.
- Very specific: line 320
Never write an unset value as null, "" or a placeholder.
- Distinctive: line 321
Never leave a flat run of prefixed scalars where a domain object fits.
- Very specific: line 322
Never duplicate a value across component blocks.
- Distinctive: line 323
Never put one component's templates under another's directory, or give a single-object component a directory of its own.
- Distinctive: line 325
Never hardcode env vars, volumes or mounts users cannot extend.
- Very specific: line 326
Never ship an outbound-TLS workload without a caCerts override.
- Very specific: line 327
Never create a Gateway or GatewayClass from an application chart.
- Very specific: line 328
Never ship a workload with a rollout history but no revisionHistoryLimit from values.yaml.
- Very specific: line 330
Never set resources.limits.cpu, and never omit any of the five requests and limits.
- Very specific: line 332
Never add a .trivyignore entry beyond KSV-0011 and KSV-0110.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Helm chart conventions
Always:
- Expose
extraEnv,extraVolumes, andextraVolumeMountsinvalues.yamlwith empty defaults ([]) and wire them into every relevant workload template (Deployment, StatefulSet, Job, etc.). - Define pod and container security context in
values.yaml, defaulting to a restricted profile aligned with Kubernetes Pod Security Standards:
The IDs must be > 10000 (Trivyglobal: podSecurityContext: runAsNonRoot: true runAsUser: 65532 runAsGroup: 65532 fsGroup: 65532 seccompProfile: type: RuntimeDefault securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true capabilities: drop: - ALLKSV-0020/KSV-0021: a low container UID collides with the host's user table). 65532 is thenonrootUID used by distroless and Chainguard images — keep it in sync with theUSERbaked into the image (seedocker-conventions), otherwise areadOnlyRootFilesystempod hits permission errors on its own state directory. - Lay out
templates/with one Kubernetes object per file, and derive every filename from the object'skindin kebab-case (split CamelCase on word boundaries, replace spaces with hyphens, lowercase — e.g.ClusterRoleBinding→cluster-role-binding.yaml,MutatingWebhookConfiguration→mutating-webhook-configuration.yaml). How files are grouped depends on how many objects a component renders:- A component that renders two or more objects gets its own
directory
templates/<component>/(matching itsvalues.yamlblock), with one kind-named file per object — e.g.templates/api/deployment.yaml,templates/api/service.yaml. - When a component renders two or more objects of the same Kind,
nest those in a per-kind subdirectory
templates/<component>/<kind>/<qualifier>.yaml. The directory carries the Kind, so each file is named by its distinguishing qualifier only — e.g. four Secrets becometemplates/api/secret/database.yaml,.../jwt.yaml,.../oidc.yaml,.../bootstrap-admin.yaml. This is Kind-agnostic: it applies equally to multiple Services (templates/api/service/grpc.yaml,.../http.yaml), ConfigMaps,Jobs, etc. A Kind with a single instance in that component stays flat astemplates/<component>/<kind>.yaml(one Service →service.yaml, notservice/http.yaml). - A component that renders a single object — typically shared
infrastructure such as an
Ingress, a Gateway route, or a databaseCluster— gets no directory: put the file at the root,templates/<kind>.yaml(e.g.templates/ingress.yaml,templates/http-route.yaml,templates/cnpg-cluster.yaml). Qualify the bare Kind with the component name when the Kind alone would be ambiguous (the genericCluster→cnpg-cluster.yaml). Never place one component's template under another component's directory.
- A component that renders two or more objects gets its own
directory
- Give each component its own
ServiceAccount(and its ownClusterRole+ClusterRoleBinding, in separate files, when it needs cluster RBAC) so components stay least-privilege and independent. - When a chart attaches a route to shared gateway infrastructure, create
only the route resource and attach it to a pre-existing gateway
referenced by name (and namespace) via
values.yaml. This applies to Gateway API and Envoy (AI) Gateway: create theMCPRoute/HTTPRoute/GRPCRoute, but never theGatewayorGatewayClass. Make the gateway name required (requiredin the template / helper) so the chart fails fast when it is missing, and default the gateway namespace to the release namespace. TheGatewayandGatewayClassare cluster-shared infrastructure owned outside the app chart. - Structure
values.yamlas exactly two kinds of top-level blocks: aglobal:block holding values shared by more than one component, plus one<component>:block per app/component holding that component's own values. As soon as a knob is needed by two or more components, it must live inglobal:at the top level — never duplicated across the component blocks, and never moved into one component's block "because that's where it's mostly used". Conversely, values used by a single component live only in that component's block. Everyglobal.*key must be overridable per component by setting the same key in that component's block (resolve via a deep-merge helper:mergeOverwrite (deepCopy global) (pick component …)), so a component can deviate from a shared default without forcing the value to move out ofglobal. A chart with a single component has noglobal:block: theglobal:keys this skill shows live in that component's block. - Group values by domain into a nested object as soon as two or more
keys concern the same concern. Within any block (
global:or a component), when more than one key relates to the same domain (database, OIDC, TLS, signing keys, a sidecar, …), nest them under a single object named for that domain instead of leaving a flat run of prefixed scalars. Drop the now-redundant prefix from each sub-key — the object name carries it. For example, prefer
over the flatdatabase: # -- (string) Connection string. Unset → built from the managed cluster. url: ~ existingSecret: # -- (string) Name of a pre-existing Secret holding the connection string. Set → takes precedence over the generated one. name: ~ # -- Key in that Secret holding the connection string. key: DATABASE_URL # -- Maximum size of the connection pool. maxConns: 25 # -- Minimum number of idle pooled connections. minConns: 5databaseUrl/databaseUrlSecret/dbMaxConns/dbMinConns. A lone key for a domain stays flat — only group once the second related key appears (the rule of two for grouping). The object's shape still maps cleanly onto its env vars / flags at the template boundary (e.g.database.maxConns→DATABASE_MAX_CONNS); grouping is avalues.yamlergonomics rule, it does not change the wire/env contract. - An
existingSecretvalue is always an object{ name, key }, never a bare string. Whenever a chart lets the user point at a pre-existing Secret instead of generating one, model it as a nested object:name(default~— unset means "generate the Secret from the inline value") andkey(the entry to read, defaulting to the same key the generated Secret would use, e.g.DATABASE_URL/UPSTREAM_HEADERS). A bareexistingSecret: ~string hardcodes the key and cannot consume a Secret whose entry is named differently — which is exactly the case pre-existing Secrets (sealed-secrets, External Secrets, cloud-synced ones) hit. Wire it through two template helpers — a…SecretName(the existingname, else the generated name) and a…SecretKey(the existingkey, else the generated default) — and reference both in thesecretKeyRef. Gate the generated-Secret template and anychecksum/…annotation onnot .Values.<path>.existingSecret.name. - Always expose a
caCertsoverride for any workload that makes outbound TLS connections (calling an upstream API, an S3/object-store endpoint, an OIDC/JWKS server, fetching a document, …). Users behind a corporate MITM proxy or with a private CA need to add a trust anchor without rebuilding the image. Model it like anexistingSecret: an inline bundle that generates a Secret, or an existing resource the user already manages — and crucially allow that existing resource to be aConfigMap(the natural home for non-secret public CA certs) as well as aSecret:
Wire it through helpers mirroring the# -- Values shared by every component. global: # -- Extra CA certificates to trust for every outbound TLS connection. Added # on top of the built-in public roots — supply only your private/corporate CA. caCerts: # -- (string) Inline PEM bundle. Stored in a Secret and mounted. Ignored when `existing.name` is set. inline: ~ # -- Mount the PEM bundle from a resource you already manage, instead of `inline`. Takes precedence over `inline` when `name` is set. existing: # -- (string) Kind of the resource: `ConfigMap` or `Secret`. kind: ConfigMap # -- (string) Name of the resource. Set → mounts from it instead of generating a Secret from `inline`. name: ~ # -- Key in the resource holding the PEM bundle (also the mounted file name). key: ca-certificates.crtexistingSecretpattern —caCertsEnabled(inline or existing set),caCertsValidate(fail fast ifexisting.kindis neitherConfigMapnorSecret),caCertsFromConfigMap,caCertsGenerateSecret(inline and no existing),caCertsSecretName,caCertsKey, and acaCertsPathfor the mount. Gate the generated Secret and thechecksum/ca-certspod annotation oncaCertsGenerateSecret; the volume picksconfigMap:vssecret:fromcaCertsFromConfigMap. Point at the mounted file with the env vars the app's runtime actually honours, not an invented name — match the language/SDK: Python →SSL_CERT_FILE,REQUESTS_CA_BUNDLE, andAWS_CA_BUNDLE(boto3); Go →SSL_CERT_FILE; Node →NODE_EXTRA_CA_CERTS; a Rust/other app that reads its own var → that var. Honour the established standard name; never prefix it with the app name. - Expose RBAC
rules(and an appendedextraRules: []) in the owning component's block ofvalues.yaml, not hardcoded in theClusterRoletemplate. - Document every key in
values.yamlwith ahelm-docs# --annotation immediately above it — no value is allowed to ship undocumented, including nested keys and empty defaults ([],{},~). The comment must describe what the value does, not just restate its name. This is a deliberate exception to the sparse-comment rule:helm-docsturns these annotations into the chart README's values table. - For an unset / undefined value in
values.yaml, use~(YAMLnull) rather than an empty string, a placeholder, or omitting the key. For an empty collection, use{}for an unset dict and[]for an unset list — never~for those, so the consumer knows the shape they are overriding. Whenever the default is~,{}, or[],helm-docscannot infer the type from the value, so you must annotate it explicitly with# -- (<type>) …(e.g.(string),(int),(bool),(object),(list),(tpl/string)). Examples:# -- Values shared by every component. global: # -- (string) Optional override for the image tag. Defaults to `.Chart.AppVersion`. imageTag: ~ # -- (object) Extra labels merged into every workload's pod template. extraPodLabels: {} # -- (list) Extra environment variables to inject into every workload. extraEnv: [] # -- Pod-level security context for every workload; loosening it breaks the restricted Pod Security Standard. podSecurityContext: # -- Refuse to start a container whose image runs as UID 0. runAsNonRoot: true - Add the
norwoodj/helm-docspre-commit hook (or a local hook invoking the installedhelm-docsbinary) to.pre-commit-config.yaml. The hook must regenerate the chartREADME.mdfromvalues.yamland fail when the regenerated file differs from the committed one, so an undocumented or stale value blocks the commit. Likewise, any generated manifest committed to the chart (e.g. a CRD) must have a pre-commit hook that regenerates it and fails if it was out of date. - Add a
helm linthook in.pre-commit-config.yaml(local hook) that runs against every chart directory. If lint needs placeholder values, keep them in avalues-lint.yamlpassed with-fand excluded from the packaged chart via.helmignore— never bake them intovalues.yaml. - Charts must comply with the Kubernetes Pod Security Standards
(restricted) profile. The default
podSecurityContext/securityContextshown above is the baseline; do not ship a chart that weakens it. - Scan the rendered chart with
trivy configand fix everyKSV-xxxxfinding. The KSV checks are the reference for what a hardened workload looks like (KSV-0020/KSV-0021UID/GID > 10000,KSV-0003drop capabilities,KSV-0014read-only root filesystem,KSV-0030seccomp,KSV-0125trusted registry, …). Treat them as errors and fix at the source — no self-authorised ignores (ci-conventions). The scan is apre-commithook, so it also gates CI throughquality:
Two traps worth knowing:- repo: local hooks: - id: trivy-chart name: trivy config (chart) entry: trivy config --exit-code 1 --helm-values charts/<chart>/values-lint.yaml charts/<chart> language: system pass_filenames: false files: ^charts/<chart>/- A chart that fails to render is reported as "Not scanned", and trivy
still exits 0. Any
requiredvalue orfailin a template silently disables the whole scan. That's why a dedicatedvalues-lint.yamlsupplying the required values is part of the chart, and why thehelm linthook takes the same file: a chart that does not render fails there instead of passing here having checked nothing. - Because it scans rendered output, findings depend on the values you feed it. Lint with the defaults a user actually gets, not a hardened-on-purpose set that hides the problem. Two checks this convention deliberately does not follow, because they are wrong for a chart rather than wrong in the chart:
KSV-0011(resources.limits.cpu) — see the resources rule below; CPU limits cause throttling and we intentionally omit them.KSV-0110(metadata.namespaceisdefault) — a chart takes its namespace fromhelm install --namespace; hardcoding it in templates is the actual anti-pattern. They are standing, pre-authorised exceptions, excluded from the gate by a.trivyignoreat the repository root, whichtrivyreads from the working directorypre-commitruns in. Add it without asking, with exactly these two IDs:
Only these two. Any other# No CPU limit: a limit throttles a compressible resource. KSV-0011 # The namespace comes from `helm install --namespace`. KSV-0110KSV-xxxxfinding gets fixed, or raised with the user. - A chart that fails to render is reported as "Not scanned", and trivy
still exits 0. Any
- Always set
resources.requestsfor CPU, memory, and ephemeral storage, andresources.limitsfor memory and ephemeral storage only. Memory and ephemeral storage are non-compressible and must be capped to protect the node; CPU is compressible and alimits.cpucauses unnecessary throttling, so leave CPU unlimited. Every workload must declare all five values —requests.cpu,requests.memory,requests.ephemeral-storage,limits.memory,limits.ephemeral-storage. Each component sizes its own, in its block. Example default:<component>: resources: requests: cpu: 50m memory: 64Mi ephemeral-storage: 64Mi limits: memory: 128Mi ephemeral-storage: 256Mi - Always set
revisionHistoryLimiton every workload that keeps a rollout history —Deployment,StatefulSet,DaemonSet. Expose it as a documented key inglobal:(default0), overridable per component like anyglobal.*key, and reference the merged value from the template; never hardcode it and never leave it out. Kubernetes defaults to10, so an unset field silently piles up ten stale ReplicaSets or ControllerRevisions per workload — noise inkubectl get rs, and etcd objects nobody will ever roll back to. Git is the record of what was deployed: a rollback is a revert and a redeploy, the same answerargocd-conventionsgives for the Application.# values.yaml global: # -- Number of old revisions each workload keeps for rollback. revisionHistoryLimit: 0
The equivalent knobs on other kinds are not this field and are not covered by this rule: a# templates/<component>/deployment.yaml spec: replicas: {{ .replicaCount }} revisionHistoryLimit: {{ .revisionHistoryLimit }}CronJobusessuccessfulJobsHistoryLimit/failedJobsHistoryLimit, and aJobhas no history at all.
Never:
- Never ship a chart that weakens the restricted security context.
- Never add a
values.yamlkey without a# --comment, or a~/{}/[]default without its(<type>)hint. - Never write an unset value as
null,""or a placeholder. - Never leave a flat run of prefixed scalars where a domain object fits.
- Never duplicate a value across component blocks; promote it to
global:. - Never put one component's templates under another's directory, or give a single-object component a directory of its own.
- Never hardcode env vars, volumes or mounts users cannot extend.
- Never ship an outbound-TLS workload without a
caCertsoverride. - Never create a
GatewayorGatewayClassfrom an application chart. - Never ship a workload with a rollout history but no
revisionHistoryLimitfromvalues.yaml. - Never set
resources.limits.cpu, and never omit any of the five requests and limits. - Never add a
.trivyignoreentry beyondKSV-0011andKSV-0110.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

