πŸ”§ DevOps

ArgoCD

Argo Continuous Delivery

A GitOps CD tool for Kubernetes. Synchronizes Git repositories with cluster state.

Detailed Explanation

ArgoCD is a Kubernetes-native GitOps CD (Continuous Delivery) tool developed at Intuit in 2018 and released as open source. As a graduated project of the CNCF (Cloud Native Computing Foundation), its reliability in enterprise environments has been proven.

Following the core principles of GitOps, it uses a Git repository as the Single Source of Truth. Applications are defined declaratively, and the actual cluster state is automatically managed so that it is synchronized with the desired state in Git.

ArgoCD continuously monitors the cluster state, and when drift occurs, it synchronizes automatically or manually. It provides enterprise-grade features such as multi-cluster management, RBAC, SSO integration, and audit logs.

In practice, it is used in integration with various templating tools such as Helm, Kustomize, and Jsonnet. Deployments can be managed through the web UI, CLI, and API, and large-scale multi-tenant environments can also be managed efficiently with ApplicationSet.

Code Example

# ArgoCD Application CRD 예제
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/myorg/my-app.git
    targetRevision: HEAD
    path: k8s/overlays/production
  destination:
    server: https://kubernetes.default.svc
    namespace: production
  syncPolicy:
    automated:
      prune: true          # Gitμ—μ„œ μ‚­μ œλœ λ¦¬μ†ŒμŠ€ μžλ™ 정리
      selfHeal: true       # μˆ˜λ™ λ³€κ²½ μžλ™ λ‘€λ°±
    syncOptions:
      - CreateNamespace=true
      - ApplyOutOfSyncOnly=true

How It's Said in Practice

Senior: "Starting this sprint, we're planning to switch to GitOps with ArgoCD. Running kubectl apply directly is prohibited, and all deployments will go only through Git PR merges."

Junior: "What happens if something was modified directly in the cluster?"

Senior: "If selfHeal is enabled, ArgoCD automatically reverts it to the state in Git. It's essential for maintaining production consistency."

Interviewer: "Please explain the difference between GitOps-style CD and traditional push-style CD."

Candidate: "In the push approach, the CI system deploys directly to the cluster, whereas in GitOps, an agent inside the cluster pulls the state from Git and applies it. Tools like ArgoCD offer security advantages, and the Git commit history serves as the deployment history, making audit trails easy."

Take a mock interview on this topic β†’ WIA SOOM AI Interview Β· Start for free

Reviewer: "There's no ignoreDifferences setting on the Application resource. Shouldn't the replicas field managed by the HPA be ignored?"

Developer: "You're right. To prevent conflicts with the HPA, I'll add the replicas field to ignoreDifferences."

Cautions

Learn More