-
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
Deploy one application to multiple namespaces within one cluster #9508
Comments
If I recall correctly, Argo CD respects whatever is in the manifest, and only uses the |
Seems not a common use case. |
It is actually. Imagine we have a bunch of apps we need to deploy to different environments like dev, sit, rc within one K8s cluster. Would be much easier if ArgoCD can accept multiple namespaces as parameter to deploy. |
Ah, my original comment doesn't make sense. I see you're trying to deploy multiple copies of a set of manifests, but to different namespaces. I'd definitely recommend ApplicationSets. The idea of duplicating at the Application level is interesting. But it's unclear to me how you'd customize on a per-namespace basis. For example, if I want my dev namespace manifests to use my dev image repository, how would I specify that in the Application spec? |
Another use case would be a multitenant cluster where you want to have multiple infra components like ingress controllers and prometheus in multiple namespaces. I don't know if this is possible as I don't use ApplicationSet, assuming the base yaml files that are being applied do not specify a namespace, maybe by specifying a single target cluster, multiple target namespaces and some kind of dynamic prefix/sufix (like namespace name) in an ApplicationSet. Maybe this would address the issue. I don't know if this is possible right now. |
That's right.
I already looked into ApplicationSet but I only found a way to deploy to multiple clusters not namespaces.
I would use different values.yaml files for different namespaces. |
Alternatively, you could template the values file name in the Application spec and then use different namespace parameters in the different values files. There's no "namespace generator," but you could just use a list generator and hard-code the names of the namespaces. |
@crenshaw-dev thanks for the hint! ApplicationSet works fine for me :)
|
Can this be re-opened? I don't understand why it was closed without a proper solution. List generator obviously does not cut it, I have to enlist every namespace manually.. there needs to be a generator that discovers namespaces, possibly with a label selector. A use case IS very obvious and very common - deliver standardized configuration to every namespace, like maybe some common secrets or configmaps etc. |
There you go https://github.com/plumber-cd/argocd-applicationset-namespaces-generator-plugin But this is of course cumbersome and requires certain plumbing and makes assumptions.. you don't really easily have access to target clusters from applicationset plugin. I really think this should be a core functionality. |
Replicating ResourceQuotas into all namespaces would be a usecase as there is no way to have cluster scoped quotas. |
Dear ArgoCD team,
I was wondering if there is a possibility to deploy one application to multiple namespaces. I would like to use one helm chart with different values files. I found only one issue about this matter - #696 but probably, something changed since. I understand that ArgoCD uses 'kubectl apply -f manifest.yaml --namespace' but could this be executed multiple times with different namespace parameter each time, for example? Or could it be like ApplicationSet but with namespace generators?
I know I can use AppOfApps but it seems like a lot of work. I need to create like 10 root apps, one for each namespace, with 50 apps inside each of them. It is hard to manage such repo. It would be much nicer to have one application definition which uses one application helm chart with multiple values files for each environment.
Probably, there is another solution for my problem but I didn't find it yet.
Thanks in advance!
The text was updated successfully, but these errors were encountered: