Skip to content
New issue

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

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

Already on GitHub? # to your account

Autocreate namespace if not present #1127

Closed
anvouk opened this issue Jul 8, 2020 · 3 comments
Closed

Autocreate namespace if not present #1127

anvouk opened this issue Jul 8, 2020 · 3 comments
Assignees
Labels
area/chart-deployment Issues related to the deployment of charts with helm kind/feature New feature or feature request

Comments

@anvouk
Copy link

anvouk commented Jul 8, 2020

Is your feature request related to a problem?
Yes

Which solution do you suggest?
One of the following:

  • Add an extra optional flag like ensureNamespace: true to enable this.
  • Add a global config/env var to enable this for all deployment
  • Change the default behaviour to automatically do this

IMHO the first option is nicer.

Which alternative solutions exist?
hooks but are very verbose and overkill for a task that needs to be executed only once.

Additional context
in my case i have the following (which is part of a bigger file):

version: v1beta9
deployments:
- name: pgadmin
  namespace: management
  helm:
    chart:
      name: pgadmin4
      repo: https://helm.runix.net/
      version: 1.2.25

however, when somebody runs it for the first time devspace aborts because no namespace management exists.

This is not really a problem for Kustomization/manifests since it can be added inside, but for helm charts deployments the only solutions I found are:

  1. add an hook which calls a yaml with the namespace definition inside before all deployments. (cannot simply use kubectl create ns management because it's not idempotent)
  2. have a separate deployment only for setup stuff.

I personally don't find neither solutions very appealing nor following k8s style.

Any suggestions?

/kind feature

@FabianKramm
Copy link
Collaborator

@QwertyQaz414 thanks for reporting this issue! Makes sense, I think we can add this feature!

@FabianKramm FabianKramm self-assigned this Jul 9, 2020
@FabianKramm FabianKramm added area/chart-deployment Issues related to the deployment of charts with helm kind/feature New feature or feature request labels Jul 9, 2020
@FabianKramm
Copy link
Collaborator

@QwertyQaz414 implemented in v4.14.0

@anvouk
Copy link
Author

anvouk commented Jul 23, 2020

Cool 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/chart-deployment Issues related to the deployment of charts with helm kind/feature New feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants