Skip to content

Argo CD Basics: How It Works and Its Components

Interactive Diagram

새 탭 ↗

ArgoCD GitOps CD ArgoCD is a CD tool that supports GitOps-style deployment.
It is an agent that synchronizes the contents of a Git repository with a Kubernetes cluster. (GitOps Operator)

  1. Declarative deployment manifest
    Declaratively define the desired state you want to deploy in the Git repo. Since the deployment manifest is declarative, deployment/rollback is easy. When a problem occurs due to a failure, etc., it is advantageous for self-healing the deployment environment.
  2. Deployment version management using Git
    All deployment-related information must be defined in Git, and each version must be recorded in the Git repository. Through this, users can easily roll back to a previous version or upgrade to a new version.
  3. Automating the reflection of changes into operations
    Once a user stores the declarative manifest in the Git repository, the actual deployment work must happen automatically. The entity responsible for this becomes a deploy operator such as ArgoCD. Through this, it reduces human error and enables continuous build/deployment.
  4. Self-healing and anomaly detection
    Once a user writes the desired state of deployment, the entity responsible for ensuring the actual deployment environment is maintained accordingly is also the deploy operator. The software that governs deployment becomes the subject, checking the current deployment state and checking for changes in the Git repository, etc., and reflecting them into the operational environment
  • ArgoCD is deployed in the form of a Pod inside the Kubernetes cluster.
  • Application deployment and lifecycle management are automated and easy to check.
  • Provides a Web UI -> resource monitoring and log output
  • Supports kustomize, helm, jsonnet, plain yaml manifest, etc.
  • Supports SSO (OIDC, OAuth2, LDAP, SAML 2.0, etc.)
  • PreSync, Sync, PostSync hooks

Existing CI/CD deployment approach

  1. The developer commits/pushes the source code
  2. A test/build pipeline is performed by a CI tool such as Jenkins.
  3. The generated container image is uploaded to the container registry.
  4. The CI/CD tool references the image information of the uploaded container and deploys the application to kubernetes. (push method)

CI/CD approach with ArgoCD applied

  1. (Same) The developer commits/pushes the source code
  2. (Same) A test/build pipeline is performed by a CI tool such as Jenkins.
  3. (Same) The generated container image is uploaded to the container registry.
  4. After updating a specific part (for example, the image tag) of the Git repository where the manifest is stored, Git commit /push.
    After this, ArgoCD detects the manifest changes and syncs them to kubernetes (pull method)
  1. Since all changes are stored in the git repo, it is easy to verify or audit.
  2. Because it has a single source of truth called the git repo, you can replicate environments easily and consistently. Very useful during failure recovery
  3. Because it uses git, the learning curve for developers is small.
  4. Rollback is easy.
  • Reconciliation Cycle Overview Reconciliation Cycle Overview
  1. API Server
    ArgoCD has an API Server that provides an API for interacting with other external systems. The API Server manages Applications, repositories, cluster credentials, authentication and authorization, etc.
  2. Repository server
    The Repository server maintains a local cache of the git repository that contains the k8s manifest files. When fetching manifest information from the git repo, this repository server is called.
  3. Application controller
    The Application controller is responsible for continuously comparing the state of the deployed application with the defined desired state and reporting to the API Server whenever they become out of sync.
    • Polls git every 3 minutes (configurable, as it is set in the argo-cd ConfigMap)
  • (Reference) Objects created during the default argocd installation
Terminal window
NAME READY UP-TO-DATE AVAILABLE
deployment.apps/argocd-application-controller 1/1 1 1
# dex server for authentication
deployment.apps/argocd-dex-server 1/1 1 1
deployment.apps/argocd-redis 1/1 1 1
deployment.apps/argocd-repo-server 1/1 1 1
# UI
deployment.apps/argocd-server 1/1 1 1

  1. Application
  • ArgoCD represents the instance of the application you want to deploy through a k8s custom resource definition (CRD) called Application.
  • Inside this ArgoCD Application, you define information such as the git repo that contains the K8s manifest files of the application to be created, the k8s server to deploy to, the namespace, and so on.
  1. App Project
  • An ArgoCD CRD used to logically separate multiple Apps into projects, a concept similar to Kubernetes namespaces
  • You can also restrict the k8s Objects that can be deployed per Project. For example, you can configure it so that an Object such as a DaemonSet, which deploys to several or all nodes for log monitoring, cannot be deployed in a specific project.
  • There is a Sync Scheduling feature per project, so all Applications of a specific Project can be deployed at a specific date/time.
  1. Repo Credentials
  • The credential needed to access the repository. ArgoCD stores the git url in a ConfigMap called argocd-cm and uses a secret containing the credential.
  1. Cluster Credentials: Used when accessing a cluster other than the one where ArgoCD is installed