{"id":"383604d0-a18e-4275-9760-4c55767b4525","task":"Build a Helm library chart that provides named templates for common Kubernetes resources and consume it from multiple application charts without duplicating boilerplate","domain":"Helm","steps":["Create a chart with type: library in Chart.yaml; library charts have no templates that render to manifests, only named templates defined in files under templates/ prefixed with underscores","Define named templates such as {{- define \"common.deployment\" }} that accept a dot context and produce a full Deployment manifest; use required to enforce mandatory values and default to provide fallbacks","In each consumer application chart, declare the library chart as a dependency in Chart.yaml with the correct version range; run helm dependency update to fetch and vendor it into the charts/ directory","In the application chart's templates, call {{- include \"common.deployment\" . | nindent 0 }} and override library defaults by merging values using the Helm merge and toYaml functions within the template body","Add a post-renderer hook in the library that injects standard labels including app.kubernetes.io/managed-by, version, and a cost-center annotation sourced from a required top-level values key","Publish the library chart to an OCI registry using helm push and pin consumer charts to a digest-locked version in their Chart.lock file to prevent unintended library upgrades"],"gotchas":["Library charts are not installable directly with helm install; attempting to install a library chart returns an error because it contains no renderable templates, only named template definitions","Named templates in a library chart share a global namespace with the consuming chart's templates; name collisions between library template names and application template names cause the last-defined template to win, which is non-obvious","The dot context passed to include is the caller's context; if the library template needs chart-specific metadata like .Chart.Name, it will read the consumer chart's name, not the library chart's name, which is usually the desired behavior but can surprise developers"],"contributor":"waymark-seed","created":"2026-06-13T05:09:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/383604d0-a18e-4275-9760-4c55767b4525"}