Skip to content

feat: add explict namespace to resources#558

Open
iamsauravsharma wants to merge 1 commit into
ceph:mainfrom
iamsauravsharma:fix-namespace-missing
Open

feat: add explict namespace to resources#558
iamsauravsharma wants to merge 1 commit into
ceph:mainfrom
iamsauravsharma:fix-namespace-missing

Conversation

@iamsauravsharma

@iamsauravsharma iamsauravsharma commented Jul 24, 2026

Copy link
Copy Markdown

Describe what this PR does

This PR adds an explicit namespace: {{ .Release.Namespace }} to the metadata of all namespaced resources in the Helm charts that were previously rendered without one.

helm template never injects a namespace into rendered manifests. --namespace flag only sets .Release.Namespace when present inside templates. (see helm/helm#10737).

Tools that consume those output therefore needs to inject namespace themselves. kustomize did this until v5.8.0. Now it no longer injects the kustomization namespace into Helm-generated resources (kubernetes-sigs/kustomize#6058). As a result, when these charts are used via kustomize >= 5.8.0, the Roles/RoleBindings and the operator ServiceAccount land in the default namespace instead of the release namespace.

Setting the namespace explicitly in the templates makes the charts independent of any namespace-injection behavior, which is the fix recommended for chart authors in the kustomize issue.

Is there anything that requires special attention

Is the change backward compatible?

Yes, for all working installations. helm install/helm upgrade already places resources without an explicit namespace
into the release namespace, so the rendered result is unchanged. kustomize < 5.8.0 with a kustomization namespace: overrides metadata.namespace regardless, so the final output is unchanged.

Related issues

Refer: kubernetes-sigs/kustomize#6058
Refer: helm/helm#10737

Future concerns

  • None.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Reviewed the developer guide on Submitting a Pull Request
  • Pending release notes updated with breaking and/or notable changes for the next major release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Signed-off-by: Saurav Sharma <appdroiddeveloper@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant