Interview Prep/Helm/Templating & Rendering Errors

`Error: rendered manifests contain a resource that already exists. Unable to continue with install: ConfigMap "shop-config" in namespace "shop" exists and cannot be imported into the current release ...` but the ConfigMap is defined twice in your own chart.

IntermediateTroubleshootingTemplating & Rendering Errors
Answer

Likely causes → Two templates (or a parent and a subchart) render an object with the same kind and name, so the second conflicts with the first within one install. Often from a hardcoded name in a subchart or a copied template.

Diagnose →

helm template shop ./shop | yq -N '[.kind, .metadata.name] | join("/")' | sort | uniq -d

Fix → Give each object a unique name via the fullname helper with a component suffix.

Prevent → A CI check for duplicate kind/name pairs in rendered output.

All Helm questions Roadmap: Helm

More on Templating & Rendering Errors