Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Helm/Release] Resources without explicit namespace are created in default namespace #1710

Closed
michael-barker opened this issue Sep 14, 2021 · 2 comments · Fixed by #1733
Closed
Assignees
Labels
area/helm helm-release-ga-blockers Items blocking Helm Release GA kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@michael-barker
Copy link

When installing a chart that has resources without an explicit namespace set to the release namespace, the resources are created in the default namespace. This can be reproduced by creating a basic chart with helm create.

helm create /tmp/test
new k8s.helm.v3.Release('test', {
      name: 'test',
      chart: 'test',
      version: '0.1.0',
      namespace: 'test',
      repositoryOpts: {
        repo: '/tmp/test',
      },
      values: {
      },
    },
  )

If the following is added to a manifest in the chart then the resource is created in the test namespace as configured in the Release resource above.

metadata:
  namespace: "{{ $.Release.Namespace }}"
@michael-barker michael-barker added the kind/bug Some behavior is incorrect or out of spec label Sep 14, 2021
@ruckc
Copy link

ruckc commented Sep 18, 2021

From a helm cli equivalent, the -n {namespace} isn't being provided. This is important for helm cli compatibility, as most charts don't specify the namespace as that should be specified at install time.

@gitfool
Copy link

gitfool commented Sep 27, 2021

I'm also interested in an option to manipulate the helm chart namespaces. Related to helm/helm#5465 (comment):

After deliberating over the use cases described earlier, I am certain they can be solved in different manners than the proposal described earlier; either by the tooling they're using (flux and spinnaker allow you to specify the namespace), by injecting the metadata yourself through the templates, or by using the post-renderer introduced in Helm 3.1.

TL;DR: chart practices will vary so when namespaces are not configurable via values it would still be useful to be able to override via other mechanisms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm helm-release-ga-blockers Items blocking Helm Release GA kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants