-
Notifications
You must be signed in to change notification settings - Fork 996
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
Display the resources created in ArgoCD associated to a CRD instance #1766
Comments
It's not clear to me yet what ArgoCD needs to display child resources? Is it really something the operator can solve (in the CRD yaml itself, in the status subresource)? |
@FxKu Digging more on github issues, It looks like it is discussed at an open ticket https://github.com/argoproj/argo-cd/issues/5082 ... t seems like we need to have labels added to the resources for tracking the relationships... https://argo-cd.readthedocs.io/en/stable/user-guide/resource_tracking/ That would be awesome to be able to visually see those resources created by the operator as we can use additional gitops tools to manage the state of the deployments... |
If it's only about labels you can configure key-value pairs that should be assigned to each resource or that should be inherited from the cluster manifest. |
ArgoCD uses the These are unfortunately not created by the operator as discussed in #498 .
ArgoCD should ideally be aware of all resources running in the cluster if a full GitOps approach is used. That includes "child resources" of the managed resources, because those are part of the application. The
Adding labels works currently, but has some downsides which is why we (in our setup) stopped using it. And this will go away eventually with a new tracking method anyway For reference the necessary settings to at least see the resources in ArgoCD are (Helm values): inherited_annotations:
- argocd.argoproj.io/compare-options
- argocd.argoproj.io/sync-options
inherited_labels:
- argocd.argoproj.io/instance #This label depends on the ArgoCD installation! The annotations will then have to be added to all |
@Wikiwix What kind of issues did you run into with label tracking? |
|
Having just tried to get ArgoCD + Zalando Postgres Operator to work smoothly together I've concluded I can't get to a perfect state but fairly close. The key thing is that I want to have the You can get to a somewhat decent state by configuring Postgres operator with:
Configure ArgoCD with:
Then set a suitable This causes all resources to appear in the ArgoCD UI and status is "Healthy", "Synced", "Sync OK". I'm also able to delete the ArgoCD Application and everything seems to clean up properly (possible exception here for a ControllerRevision resource that seems to have lingered around). These are the potential caveats I see with such a setup:
In cases like this I think it would be immensely helpful to have something like a StatefulSet's |
I've found another workaround, using https://kyverno.io/ Kyverno can patch resources in the cluster, either when they are created or using a background controller on a certain interval (default is 1 hour I believe). I've implemented a background policy that updates the Here is the ClusterPolicy and the Kyverno helm values that i've used: https://gist.github.com/c0deaddict/79054d2f0b145518d96dfb894a8a2c2c The same trick can be used to link the other |
We're using postgres operator 1.14.0 with the ownerReference feature implemented in #498 and all is working fine in argo-cd. From my point of view this issue can be closed. |
Please, answer some short questions which should help us to understand your problem / question better?
Which image of the operator are you using?
registry.opensource.zalan.do/acid/postgres-operator:v1.7.1
Where do you run it - cloud or metal? Kubernetes or OpenShift?
AWS K8s EKS
Are you running Postgres Operator in production?
yes
Type of issue?
feature request
🐛 Current Implementation
postgres
, but we don't see the list of resources❓What to display the created resources?
Events section
🎉 What should we see?
🔧 Configuration Used
The text was updated successfully, but these errors were encountered: