CICD for Kubernetes with Argo CD and GitOps
Lets take Argo CD for a Spin in this week's article
Argo CD is part of Argo project which was open sourced by Intuit, my former employer :) . Something I am very proud to write about in today's post :
The projects under Argo are :
- Argo CD
- Argo CI
- Argo Workflow
- Argo Events
Each of these projects make continuous delivery on Kubernetes convenient by removing layers of complexities that are usually present in any deployment pipeline. Argo CD runs a open source Kubernetes controller to get leveraged as a GitOps based declarative deployment model.
Here's how it facilitates the deployment workflow :
Essentially you maintain two repos(based on GitOps model)in Git serving as a single source of truth,
Imagine you have repoA for your code checkins and repoB for storing the Kubernetes manifests files (controled by Helm for example).
From a developers perspective, when you do a checkin to git repoA, your Jenkins CI kicks off to build the artifact/image and pushes it to your artifactory and publishes the new image id in to your Kubernetes manifest files in your deployment repoB.
Now, you have Argo CD doing a constant diff with your deployment repoB. The moment it finds a new image id, it runs "kubectl apply" to bring your application to the same level with that of Git. This approach is called a declarative deployment model.
Image credit : https://argoproj.github.io/argo-cd/operator-manual/architecture/
What are the benefits ?
- Smooth rollback process. Something went wrong, just change the image id to its previous one and you get rolled back as you sip your coffee
- Perfect fit for Kubernetes declarative model
Learn more about Argo
https://argoproj.github.io/argo-cd/#what-is-argo-cd