Gitops with Argo CD & Kyma
I want to share with everyone my experience with Argo CD & Kyma, I’ll cover the following topics during this blog:
- Understand basics of Argo CD
- To show how a simple SAP CAP application is deployed automatically from github repository into Kyma using Argo CD
- To show how many kubernetes objects are created after the deployment
1-Basics of Argo CD
What Is Argo CD?
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
Why Argo CD?
Application definitions, configurations, and environments should be declarative and version controlled. Application deployment and lifecycle management should be automated, auditable, and easy to understand.
At a high level, the Argo CD process works like this:
- A developer makes changes to an application, pushing a new version of Kubernetes resource definitions to a Git repo.
- Continuous integration is triggered, resulting in a new container image saved to a registry.
- A developer issues a pull request, changing Kubernetes manifests, which are created either manually or automatically.
- The pull request is reviewed and changes are merged to the main branch. This triggers a webhook which tells Argo CD a change was made.
- Argo CD clones the repo and compares the application state with the current state of the Kubernetes cluster. It applies the required changes to cluster configuration.
- Kubernetes uses its controllers to reconcile the changes required to cluster resources, until it achieves the desired configuration.
- Argo CD monitors progress and when the Kubernetes cluster is ready, reports that the application is in sync.
- ArgoCD also works in the other direction, monitoring changes in the Kubernetes cluster and discarding them if they don’t match the current configuration in Git.
2 – Deploying SAP CAP App using Argo CD & Kyma
Let’s see it in action:
For simplicity the SAP CAP application & configuration ( chart folder ) are stored in the same repository:
After installing Argo CD in the cluster you can create the Argo CD application using the following definition:
You can see bellow how the application looks like in Argo CD:
3 – Exploring created k8s Objects in Argo CD inside of Kyma
It’s really amazing what this graduated CNCF project can do for the Gitops, and I hope to see it as a module in Kyma some day, what is stopping you to use it? 🙂
- Argo CD https://argo-cd.readthedocs.io/en/stable/
- Codefresh https://codefresh.io/learn/argo-cd/
- CNCF https://www.cncf.io/announcements/2022/12/06/the-cloud-native-computing-foundation-announces-argo-has-graduated/