-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Automatically create namespace with application #1809
Comments
Could you add the namespace manifest to the application? |
Thanks for the tip. Adding a namespace manifest works. However, I have to hard code the namespace name in the manifest. Is there also a way to choose the namespace using the web ui and then let Argo CD create the namespace? |
While I agree it would be a convenient feature, we need to be careful with auto-creation of namespaces:
|
True, that feature can be a little bit dangerous. For me, adding a namespace manifest with a hard-coded name is sufficient. Do you want to keep this open for the discussion about auto-creating namespaces with user-definied names? |
Could you use Helm or Kustomize to parameterise the namespace? |
Thanks for the tip. Creating a file named
Disadvantage is that I would have to modify the chart (which is not possible in most cases). But for me, the alternatives mentioned in the comments are sufficient. |
So to be sure the recommendation is that namespaces should either be part of the helm chart or should be handled externally in contrast with the CI/CD tool taking care of it |
Is there any chance this can be revisited with the addition of native Helm applications with ArgoCD 1.3? |
Creating the namespace would be cool, just pointing out it is a slippery slope. We'll want annotations on it next for KIAM. |
e.g. If I'm trying to deploy a new application; who should create the namespace for it (and when?) At the moment, to have an project create namespace needs permissions to create arbitrary namespaces: could this be narrowed? (so that e.g. a project with permissions in namespace |
Because of the recent discussions, I have reopened the issue. |
would it be possible to use argo workflow here to create the namespace? I too would like to have the namespace created if it didn't exist and removed upon delete Update |
Putting it in as a manifest doesn't work well when there are presync hooks in the Application, because then the Namespace has to be a PreSync hook. |
I just make a different release using the raw chart that has all my namespaces in it.
ezymode. |
Hi, I need to create a configmap before my presync job run, seems like the same issue as here, any ideas? |
For those getting here through google search, it's possible to create a namespace as part of the Application CRD:
Check ArgoCD Application CRD |
Is there also a way to delete the namespace when removing the manifest? Pruning enabled seems to leave the namespace intact. |
How do I update sync policy?
Is the feature ready or not?
I still get error that it can't automatically create the namespace
|
Yes, that's correct. If you're having issues with it, there's an ArgoCD Slack Channel in the CNCF Slack, there you could get help with support in the #argo-cd channel. You may want to check what version, post your applications yaml definition there, there might be something wrong with the syntax. Review the application.yaml that I link to in my previos post. |
Hey Bill, Long time ;) I just tried the same with version |
If you reached here, know that I was for days trying to do this work on the latest version. Then I saw this last comment about |
it works |
Is your feature request related to a problem? Please describe.
Currently, when an application is created using Argo CD and the namespace does not exist, the synchronization of that application fails with the error
Error from server (NotFound): namespaces "<namespace>" not found
. I am then forced to use kubectl to create the namespace.Describe the solution you'd like
I would like Argo CD to automatically create non-existing namespaces when I create an application.
The text was updated successfully, but these errors were encountered: