Helm values.schema.json Authoring Prompt
Generate a strict JSON Schema for a Helm chart's values so bad inputs fail at `helm install` time with clear errors, not as a broken Deployment 90 seconds later.
- Target user
- Chart authors who want fail-fast, self-documenting values
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Helm chart maintainer who treats `values.schema.json` as the chart's API contract and refuses to let invalid values reach the cluster. I will provide: - The chart's `values.yaml` (with comments) - The templates that consume those values (so you see which keys are required vs optional) - Any known footguns users hit (wrong types, missing required fields, invalid enums) Your job: 1. **Derive the schema from real usage** — for every value referenced in templates, infer its type, whether it is required, and sane constraints. Do not just mirror `values.yaml`; encode the rules the templates actually assume. 2. **Required vs optional** — mark a key `required` only if the chart breaks without it. For optional keys with defaults, allow them to be absent rather than forcing the user to set them. 3. **Strong constraints** — use `enum` for fixed choices (e.g. `service.type`), `pattern` for things like image tags / RFC1123 names, `minimum`/`maximum` for replica counts and ports, and `format` where appropriate. Add `additionalProperties: false` on objects where typos are dangerous. 4. **Resource quantity validation** — provide a reusable `pattern` for Kubernetes CPU (`^[0-9]+m?$`) and memory (`^[0-9]+(Mi|Gi|Ki|M|G)?$`) quantities so `cpu: "100mm"` is rejected up front. 5. **Cross-field rules** — where JSON Schema allows (`if`/`then`, `dependentRequired`), encode conditional requirements, e.g. if `ingress.enabled: true` then `ingress.host` is required; if `autoscaling.enabled` then `minReplicas`/`maxReplicas` are required and `min <= max`. 6. **Good error messages** — add `description` and `title` to every property so `helm install` validation output is self-explanatory. 7. **What schema CANNOT catch** — list rules that need a CI policy check or a `helpers.tpl` `fail` call instead (e.g. mutually exclusive features, semantic version compatibility). 8. **Test it** — provide 3 invalid values files that SHOULD be rejected and 1 valid one, plus the `helm lint` / `helm template` commands to prove each case. Output as: (a) complete `values.schema.json`, (b) the `fail`-based guards for rules schema can't express, (c) the test values files + commands, (d) a short note on Helm version compatibility for the schema features used. Bias toward: strictness, clear descriptions, and rejecting typos early.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Helm Chart Review Prompt
Get a senior-engineer review of a Helm chart — values hygiene, template correctness, security defaults, upgrade safety.
-
Helm Secrets + SOPS Encrypted Values Workflow Prompt
Design a GitOps-safe workflow for encrypting Helm values with the helm-secrets plugin and SOPS (age/KMS) — encrypted values in git, decryption at deploy time, key rotation, and CI wiring.
-
Helm Test Hook Integration Suite Prompt
Design a `helm test` suite using test hooks — connectivity, schema, and smoke checks as Pods/Jobs with helm.sh/hook: test, proper hook-delete-policy, and CI integration after install/upgrade.
-
Helm Stuck Pending Release State Recovery Prompt
Recover a Helm release stuck in pending-install, pending-upgrade, or pending-rollback after a failed or interrupted operation — without corrupting release history or losing live workloads.
More Kubernetes & Helm prompts & error guides
Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.