Skip to content
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

Support getting lineage for ArgoCD Applications #18

Open
anandf opened this issue Sep 16, 2024 · 4 comments
Open

Support getting lineage for ArgoCD Applications #18

anandf opened this issue Sep 16, 2024 · 4 comments

Comments

@anandf
Copy link

anandf commented Sep 16, 2024

This is a wonderful and promising tool.

I have seen a note that currently it does not support ArgoCD Applications. When I tried running on it, I could just see the events generated by these applications instead of the actual child objects. I would like to enhance this tool to add support for ArgoCD applications as well.

argocd app create guestbook --core --repo https://github.com/anandf/argocd-example-apps.git --path kustomize-guestbook --dest-namespace guestbook --dest-server https://kubernetes.default.svc --sync-policy automated --self-heal --sync-option CreateNamespace=true
application 'guestbook' created
argocd app list --core
NAME              CLUSTER                         NAMESPACE  PROJECT  STATUS  HEALTH       SYNCPOLICY  CONDITIONS  REPO                                               PATH                 TARGET
argocd/guestbook  https://kubernetes.default.svc  guestbook  default  Synced  Progressing  Auto        <none>      https://github.com/anandf/argocd-example-apps.git  kustomize-guestbook

On running lineage command, I get this output

 k lineage application guestbook
NAME                                   READY   STATUS                                                                                     AGE
Application/guestbook                  -                                                                                                  26s
├── Event/guestbook.17f5a5a5b1bdf768   -       ResourceCreated: Unknown user created application                                          26s
├── Event/guestbook.17f5a5a5fa724984   -       OperationStarted: Initiated automated sync to 'd7927a27b4533926b7d86b5f249cd9ebe7625e90'   25s
├── Event/guestbook.17f5a5a5fa90d1f4   -       ResourceUpdated: Updated sync status:  -> OutOfSync                                        25s
├── Event/guestbook.17f5a5a5fabf4424   -       ResourceUpdated: Updated health status:  -> Missing                                        25s
├── Event/guestbook.17f5a5a67f31db2d   -       ResourceUpdated: Updated sync status: OutOfSync -> Synced                                  23s
├── Event/guestbook.17f5a5a67f483a16   -       OperationCompleted: Sync operation to d7927a27b4533926b7d86b5f249cd9ebe7625e90 succeeded   23s
└── Event/guestbook.17f5a5a67f551fb2   -       ResourceUpdated: Updated health status: Missing -> Progressing                             23s

Expected Output

|- Namespace/guestbook   -                8m45s
|- Deployment/kustomize-guestbook-ui                                           0/1                                                                                                                 5m44s
 └── ReplicaSet/kustomize-guestbook-ui-9b9c89b69                             0/1                                                                                                                 5m44s
    └── Pod/kustomize-guestbook-ui-9b9c89b69-qnr66                          0/1     ContainerCreating                                                                                           5m44s                                                                                                        5m44s
|- Service/kustomize-guestbook-ui                   -                7m36s
└── EndpointSlice/kustomize-guestbook-ui-b5xbb   -                7m36s
@tohjustin
Copy link
Owner

@anandf this is a great idea 😊

I suppose it's just matching Argo CD Application/<APP_NAME> custom resource with other k8s resources containing the argocd.argoproj.io/instance=<APP_NAME> label?

@tohjustin
Copy link
Owner

I haven't had much time these while to do maintenance on this tool, but do feel free to work on this & I'll do my best to review it & publish a version 🙏

@anandf
Copy link
Author

anandf commented Sep 17, 2024

ArgoCD uses either a label app.kubernetes.io/instance: some-application (or) an annotation argocd.argoproj.io/tracking-id (or) both to track application created resources. There is also an option to specify a custom label. Once the direct resources are identified, we need to track its individual children using existing logic. Custom label selector can be supported by having an additional optional argument for the lineage command

@tohjustin
Copy link
Owner

I see, thanks for sharing this!
Would greatly appreciate if you can also update over here when you've started working on this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants