feat: add explict namespace to resources#558
Open
iamsauravsharma wants to merge 1 commit into
Open
Conversation
Signed-off-by: Saurav Sharma <appdroiddeveloper@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 templatenever injects a namespace into rendered manifests.--namespaceflag only sets.Release.Namespacewhen 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 upgradealready places resources without an explicit namespaceinto the release namespace, so the rendered result is unchanged. kustomize < 5.8.0 with a kustomization
namespace:overridesmetadata.namespaceregardless, so the final output is unchanged.Related issues
Refer: kubernetes-sigs/kustomize#6058
Refer: helm/helm#10737
Future concerns
Checklist: