Chart dependencies and schema
Values form a chart interface
A values.schema.json file describes accepted merged inputs, rather than Kubernetes resource fields. This chart accepts integer replicaCount from zero to five and boolean showBanner. It rejects a quoted "2" as a string and an empty message. A schema checks the merged values, including overrides and child-chart requirements; it does not verify generated selectors, API support or application behavior. A JSON Schema default annotation is not a replacement for values.yaml.
{ "type": "integer", "minimum": 0, "maximum": 5}Declare and review dependencies
A subchart is another chart packaged inside a parent. The notices dependency uses an exact version and a local file source, with an explicit condition. A reviewed copy is present under catalog/charts/notices, and the source is at ../notices. The two copies are byte-identical in this fixture. A library chart supplies reusable template definitions rather than being installed directly as an application chart. Dependencies can add unexpected workloads and hooks; inspect every chart before installation.
apiVersion: v2name: catalogversion: 0.2.0appVersion: "1.0.0"type: applicationdependencies: - name: notices version: 0.1.0 repository: "file://../notices" condition: notices.enabledParent, child and global values
The parent overrides notices.text using a nested key in its own values. The child sees that value as .Values.text, not .Values.notices.text. Global values are deliberately shared downward: both parent and child can refer to .Values.global.environment. The condition notices.enabled=false disables the dependency. Keep interfaces small; globals are not a place to share credentials.
notices: enabled: true text: Parent noticeglobal: environment: studyLock dependency resolution
A reviewed dependency update resolves declared versions and writes Chart.lock; dependency build reconstructs dependencies from that lock when present. Without a lock, build may resolve dependencies instead. Locks capture dependency resolution, not proof that downloaded packages are authentic; retain reviewed artifacts and verify provenance or hashes separately. Do not run these commands against unknown repositories or credentials. The fixture has no generated Chart.lock because Helm is absent. The local copies permit review without downloading.
# Optional in a disposable copy with approved local sourceshelm dependency update ./cataloghelm dependency build ./catalogTest the interface separately from rendering
Predict the schema results before using Helm. The default and alternate values should pass; invalid.yaml fails the integer requirement. Zero is permitted because it represents a deliberate scaling input. Local JSON Schema tests exercise the declared constraints, not Helm’s merge engine. Then, in an approved toolchain, run lint and template with each case and inspect the resulting manifest separately.
helm lint ./catalog -f alternate.yamlhelm template demo ./catalog -f invalid.yaml # expected failureCheck Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Chart dependencies and schema — knowledge check
Apply concepts to the original offline chart fixtures.
Which input satisfies the replica schema?
How does the child read the parent override notices.text?
What disables the notices dependency?
What is Chart.lock for?
What remains unproven after values schema validation?