-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Application referencing project xyz which does not exist #21150
Comments
Another workaround is to create the
Remark: The issue that we have we this approach is that many users will not been able to create/delete an |
Hi, can confirm this issue also occurs on ArgoCD version I'm running a setup with two ArgoCD instances for separation of concerns between infrastructure and applicative teams, each running in their own namespace ( The second instance (applicative) is configured for multitenancy with Application(+Set) in any namespace. Creating an AppProject in the However, when an Application is scoped to this AppProject, it fails while syncing:
Creating the same AppProj in the "default" ArgoCD namespace (in my case It's as-if one of the ArgoCD API request does not take in account the control-plane namespace for its current ArgoCD instance when querying AppProjects, and instead defaults to the default one ( Reading the code I deduced this call stack:
I believe the issue comes from an incorrect namespace given to the AppProjectLister::Get method: argo-cd/pkg/client/listers/application/v1alpha1/appproject.go Lines 74 to 77 in af54ef8
The namespace used to query AppProject objects is set through the constructor of the AppProjectNamespaceLister object here, reading the code it should be equal to the ApplicationController's namespace: argo-cd/controller/appcontroller.go Line 372 in af54ef8
I will create a debug environment when I get the time and figure out what is going on. @cmoulliard Can you tell me where in the documentation is mentioned the fact that you can create AppProjects objects outside of the ArgoCD namespace ? Because reading the code I don't see how this could work ... |
Well this is embarrassing, I found out why my setup wasn't working. Both ArgoCD instances had the same applicative namespace configured for the Application-in-any-namespace feature and were fighting for control over it. However this confirms that AppProjects can only be located in the control-plane namespace, as the ApplicationController instance looks for them in the same namespace where he is running in itself. This makes sense since AppProjects are not meant for self-service and are restricted to ArgoCD administrators. @cmoulliard What's your use-case for self-service AppProjects (i-e, outside of argocd control plane namespace) ? |
The existing documentation don't mention at all that we should use an |
My use is pretty simple. We would like to offer the possibility that users creates their applications within their own namespaces and that argocd reconcile them (= synced) without the need to touch a |
True, I guess it is self-implied because if you allow users to create AppProjects, they effectively become ArgoCD administrators which doesn't make sense for most use-cases.
What you could do is use a Kyverno generate policy, that, on AppProject creation:
(See: https://kyverno.io/docs/writing-policies/generate/) This obviously comes with some issues and edge cases but you seem to have a really specific use-case and that would be my approach with it. But ideally you would have a process that automates the creation of an AppProject when creating the project for a user |
We have a project able to generate such an |
Documentation should be improved to clearly warn the user that the |
Agreed 😄 |
That is correct. All resources should be created in the argo control-plane namespace, unless specified otherwise. AppProject is the Security and tenancy control, allowing users to create them without validation would not make sense. |
@cmoulliard Please open a PR on what you think the wording in the documentation should be to avoid confusion, or close the issue. |
Checklist:
argocd version
.Describe the bug
When an Application is installed on a cluster within a user's namespace and where its AppProject is also installed within a user's namespace, then we got as error within the Application resource status:
even if the AppProject is well created under the user's namespace.
This issue has been discussed here: #8402 (reply in thread)
To Reproduce
test
application.namespaces: test
Expected behavior
The Argocd Applications: bootstrap-app and guestbook should be installed and status been: sync and health
Screenshots
Version
Logs
Remark
There is a workaround which is to create 2 AppProjects: one under argocd namespace and the other under the user's namespace.
The text was updated successfully, but these errors were encountered: