-
Notifications
You must be signed in to change notification settings - Fork 566
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
Helm3 doesn't automatically create namespace #891
Comments
@costimuraru Good point! I think incubator/raw would be handy for this use-case:
|
Thanks, @mumoshu. Yes that also crossed my mind, though we're seeing some issues with incubator/raw and helm3. Opened an issue in helm to track it: helm/helm#6626 |
We've been doing this with hooks for the moment:
You can definitely improve on that but for now that's what we've been doing. |
@mikesplain That's neat. Thanks for sharing! |
@mikesplain I do something similar for cert-manager; something to mind is that the |
We've also discussed a couple more solutions we could solve this:
releases:
- name: "create-namespaces-chart"
chart: "adobe/create-namespaces-chart"
- name: "namespaces[0]"
value: "logging"
- name: "namespaces[1]"
value: "monitoring"
- name: "namespaces[2]"
value: "velero"
|
@costimuraru I don't think this is a good way to create namespaces. In case you accidentally delete chart, all your work will be gone 😱 And eventually the process of recovering all your apps will be a nightmare.. |
@volym3ad Good point. Definitely this needs to be handled beforehand, or directly by helmfile. |
@scottrigby Thanks for sharing! I'll definitely check |
Using a pre-install and pre-upgrade hook can also prevent the deletion problem |
@mikesplain Good point! Then it seems to be the best option we can have today. |
My immediate idea was to chain any helm calls from Helmfile with The next idea was to change Helmfile to call kubectl or client-go to create the namespace. But it wouldn't work for users who wants to manage namespaces externally to the main helmfile.yaml. How about adding a flag to optionally enable creating K8s namespace with kubectl? It should look like |
That could work |
Please add this. |
@maver1ck Which feature do you want specifically and how |
Worst part about that is that the feature was removed in Helm3 without a notice and cli still takes in namespace param... This is very confusing, just learnt about that while moving to helm3... |
I don't really like the idea of a prehook with kubectl apply as it has a few drawbacks.
namespace.yaml template within the namespace chart:
This will ensure that when you are running Let me know what you think! |
That would be the missing detail that would make namespaces managed by helm an option! Will look into it after new year. Until yet hadn't thought of anything better then bash/kubectl glue, that takes the namespaces defined in the helmfile yaml as a starting point and would precede helmfile. |
The Helm team is working on a helm cli flag that would allow the deployer to choose to have Helm 3 create namespaces. See: |
Looks like |
Helmfile is going to create namespaces by default thanks to |
- createNamespace is a new attribute that can be added to helmDefaults or an individual release to enforce the creation of a release namespace during sync if the namespace does not exist. This leverages helm's (3.2+) --create-namespace flag for the install/upgrade command. If running helm < 3.2, the createNamespace attribute has no effect. Resolves roboll#891 Resolves roboll#1140
- createNamespace is a new attribute that can be added to helmDefaults or an individual release to enforce the creation of a release namespace during sync if the namespace does not exist. This leverages helm's (3.2+) --create-namespace flag for the install/upgrade command. If running helm < 3.2, the createNamespace attribute has no effect. Resolves roboll#891 Resolves roboll#1140
- createNamespace is a new attribute that can be added to helmDefaults or an individual release to enforce the creation of a release namespace during sync if the namespace does not exist. This leverages helm's (3.2+) --create-namespace flag for the install/upgrade command. If running helm < 3.2, the createNamespace attribute has no effect. Resolves roboll#891 Resolves roboll#1140
- createNamespace is a new attribute that can be added to helmDefaults or an individual release to enforce the creation of a release namespace during sync if the namespace does not exist. This leverages helm's (3.2+) --create-namespace flag for the install/upgrade command. If running helm < 3.2, the createNamespace attribute has no effect. Resolves #891 Resolves #1140
For fun, add pre-hook 🤓
hehehe.. it works! |
@abdennour despite of args: ["--context", "{{`{{.Release.KubeContext}}`}}", "create", "ns", "{{`{{ .Release.Namespace }}`}}"] Does helmfile check hook exit code? |
Helm3 doesn't automatically create namespace - see https://v3.helm.sh/docs/faq/#automatically-creating-namespaces
How can we solve this with helmfile, so that we don't have to manually create them?
The text was updated successfully, but these errors were encountered: