Gitops with Argo CD & Kyma
2023-11-3 02:37:36 Author: blogs.sap.com(查看原文) 阅读量:5 收藏

Hi all,

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:

  1. A developer makes changes to an application, pushing a new version of Kubernetes resource definitions to a Git repo.
  2. Continuous integration is triggered, resulting in a new container image saved to a registry.
  3. A developer issues a pull request, changing Kubernetes manifests, which are created either manually or automatically.
  4. 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.
  5. 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.
  6. Kubernetes uses its controllers to reconcile the changes required to cluster resources, until it achieves the desired configuration.
  7. Argo CD monitors progress and when the Kubernetes cluster is ready, reports that the application is in sync.
  8. 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.

Argo%20CD%20process

2 – Deploying SAP CAP App using Argo CD & Kyma

Let’s see it in action:

Architecture ( demo app used )

For simplicity the SAP CAP application & configuration ( chart folder ) are stored in the same repository:

Github%20repository

Github repository

After installing Argo CD in the cluster you can create the Argo CD application using the following definition:

Argo%20CD%20Application%20definition

Argo CD Application definition

You can see bellow how the application looks like in Argo CD:

Argo%20CD%20Application%20in%20UI

Argo CD Application in UI

3 – Exploring created k8s Objects in Argo CD inside of Kyma

You can see bellow all the kubernetes objects created automatically inside of the Kyma cluster for this demo app:

k8s%20objects%201/4

k8s objects 1/4

k8s%20objects%202/4

k8s objects 2/4

k8s%20objects%203/4

k8s objects 3/4

k8s%20objects%204/4

k8s objects 4/4

SAP%20CAP%20App%20running%20inside%20of%20Kyma

SAP CAP App running 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? 🙂

Sources:

  1. Argo CD https://argo-cd.readthedocs.io/en/stable/
  2. Codefresh https://codefresh.io/learn/argo-cd/
  3. CNCF https://www.cncf.io/announcements/2022/12/06/the-cloud-native-computing-foundation-announces-argo-has-graduated/

文章来源: https://blogs.sap.com/2023/11/02/gitops-with-argo-cd-kyma/
如有侵权请联系:admin#unsafe.sh