How Can I Track Changes in Argocd Deployments with a Script?

0
2
Asked By TechieNomad42 On

I'm diving into a K8S project and learning quickly, but I'm a bit out of my depth with Argocd. We're deploying our Helm charts and manifests using Argocd, and I have a task that I need help with. I want to figure out how to identify the pods or apps that have changed when the Argocd pipeline runs. My goal is to output the changes or a changelog to the terminal every time something updates, so we can track what was altered in past deployments.

I plan to achieve this with a Python script that runs in the pipeline, which would:

1. Check the current deployment values file (nonprod/preprod/prod).
2. Fetch the versions of all pods.
3. Compare those with previous versions (not sure where to get these—maybe check the last merge?)
4. If there are version changes,
5. Query the GitLab API to get the last merge title or similar info.
6. Finally, echo the output to the terminal.

I'd love to hear how others would approach this! My background is mostly in AWS and Terraform, so this is a new kind of challenge for me.

1 Answer

Answered By K8SNewbie77 On

When you run your pipeline, you're likely treating Argocd like a pipeline tool, but it's really a desired state engine for managing your app's deployments. It compares the state in your Git repo with your K8s cluster. If there's a difference, it flags the app as 'Out of Sync'. You should consider switching to automatic syncing, which could simplify the whole process for you!

TechieNomad42 -

I see what you mean! I plan to discuss this with a colleague, as it seems we might be overcomplicating things. Thanks for clarifying!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.