Summary
Add a label that can be put on namespaces to allow applications to be deployed in them.
Motivation
Currently the apps in any namespaces feature requires two conditions to be true to allow for an application to be deployed in the namespace.
- The namespaces name must be present in list for the CLI flag
--application-namespaces.
- The namespace must be present in the
.spec.sourceNamespaces field of the application's app project.
At the current moment namespaces can be listed with shell-style wildcards and regexes. However both of these options require the namespaces that are planned to be used for application deployments to follow a specific pattern.
In environments where the namespace naming scheme is not consistent it can be tedious to add new namespaces to the list. Each new namespace added to the --application-namespaces list requires a restart of the application controller as well.
Proposal
To allow for namespaces that do not follow a specific naming scheme to be automatically included. A new label could be provided on the namespace to mark it as a source namespace. So if a namespace like the following example was deployed:
apiVersion: v1
kind: Namespace
metadata:
name: namespace
labels:
argocd.argoproj.io/source-namespace: "true"
Applications would then be able to be reconciled in that namespace.
Because this addition would not be easy to check in the .spec.sourceNamespaces a new field in the app project will also be needed to keep the role that the app project plays in apps in any namespaces. It could be something like .spec.allowAnnotatedSourceNamespaces. When this field is set to true it will allow for applications apart of this app project to deploy to annotated namespaces.
Another consideration is if a namespace has the label but is not listed in the --application-namespaces parameter and is used in the .spec.sourceNamespaces it should still be considered valid for more fine control if needed.
Summary
Add a label that can be put on namespaces to allow applications to be deployed in them.
Motivation
Currently the apps in any namespaces feature requires two conditions to be true to allow for an application to be deployed in the namespace.
--application-namespaces..spec.sourceNamespacesfield of the application's app project.At the current moment namespaces can be listed with shell-style wildcards and regexes. However both of these options require the namespaces that are planned to be used for application deployments to follow a specific pattern.
In environments where the namespace naming scheme is not consistent it can be tedious to add new namespaces to the list. Each new namespace added to the
--application-namespaceslist requires a restart of the application controller as well.Proposal
To allow for namespaces that do not follow a specific naming scheme to be automatically included. A new label could be provided on the namespace to mark it as a source namespace. So if a namespace like the following example was deployed:
Applications would then be able to be reconciled in that namespace.
Because this addition would not be easy to check in the
.spec.sourceNamespacesa new field in the app project will also be needed to keep the role that the app project plays in apps in any namespaces. It could be something like.spec.allowAnnotatedSourceNamespaces. When this field is set to true it will allow for applications apart of this app project to deploy to annotated namespaces.Another consideration is if a namespace has the label but is not listed in the
--application-namespacesparameter and is used in the.spec.sourceNamespacesit should still be considered valid for more fine control if needed.