Argo CD 기반 GitOps Delivery: Component, Object와 Utility 배포
Delivery Control Plane은 Git의 desired state와 클러스터의 실제 상태를 지속적으로 비교하고 조정할 수 있어야 한다.
배포 서버 (GitOps 기반) 관리
섹션 제목: “배포 서버 (GitOps 기반) 관리”GitOps란 배포의 형상을 선언형으로 기술하여 Config 리포지토리에서 관리하고, 이를 운영 환경 간의 상태 차이가 없도록 유지하는 방식이다. 권한관리가 보장된 Git Server Hosted Service의 웹 UI 기반으로 배포 정의를 편하게 확인할 수 있고, 단일 진실 원천(Single source of truth)으로 신뢰성을 유지할 수 있다. Git commit/push 기능을 통해 manifests code가 관리되므로 별도 설정 없이도 배포 이력과 감사 로그가 관리되고, Rollback도 특정 Git 리비전으로 동기화하는 것이라 안전하다.
IaC와의 차이는 다음과 같다.
| GitOps | IaC | |
|---|---|---|
| 관리대상 | Kubernetes 리소스들 | 모든 인프라(local, Cloud, Kubernetes) |
| 원천소스 | git | git 외에도 설정 저장가능 |
| 개념 | IaC 중 Kubernetes에 특화된 패턴 | Tool에서 지원 가능한 모든 인프라를 관리하는 패턴 |
| 도구 | Argo CD, Flux | Terraform, Ansible, Chef 등 |
Argo CD Basics
섹션 제목: “Argo CD Basics”Argo CD는 GitOps 스타일의 배포를 지원하는 CD Toolkit이며, Git 저장소의 내용과 Kubernetes Cluster를 동기화해주는 GitOps Operator의 역할을 수행한다.

핵심 개념은 다음과 같다.
- 선언형 배포 작업 정의서: Git repository에 배포하길 원하는 상태를 선언적으로 정의하고, 문제 발생 시 배포 환경 Self-Healing이 가능하다.
- Git 기반 배포 버전 관리: 모든 배포 관련 정보가 Git 저장소 이력으로 존재해서, 이전 버전으로 롤백하거나 새 버전으로 업그레이드할 수 있다.
- 변경 사항 운영 반영 자동화: Git 저장소에 선언형 정의서를 저장하면 실제 배포는 자동으로 이뤄지며(e.g. Application Auto Sync), human error를 줄인다.
- 자가 치유 및 이상 탐지: 사용자가 작성한 desired state에 맞게 실제 배포 환경이 유지되고 있는지 Argo CD가 지속적으로 확인한다.
Push Based vs Pull Based Deployment
섹션 제목: “Push Based vs Pull Based Deployment”Push Based Deployment
- 개발자가 소스코드를 commit & push
- Jenkins/GitHub Actions 등 CI 도구에 의해 테스트/빌드 pipeline 수행
- 생성된 컨테이너 이미지를 컨테이너 저장소에 업로드
- CI/CD Tool이 업로드한 이미지 정보를 참조해서, pipeline 실행 기반으로 kubernetes에 애플리케이션을 배포

Pull Based Deployment
- (동일) 개발자가 소스코드를 commit/push
- (동일) CI 도구에 의해 테스트/빌드 pipeline 수행
- (동일) 생성된 컨테이너 이미지를 컨테이너 저장소에 업로드
- manifest가 저장된 Git 저장소의 특정 부분(e.g. Container Image Tag)을 업데이트한 후 commit & push
- 이후로는 Argo CD가 manifest 변경사항을 감지하여 kubernetes에 sync (Pipeline 기반 sync 혹은 API 호출 기반 수동 배포, 또는 Application Auto Sync)

Argo CD 핵심 컴포넌트
섹션 제목: “Argo CD 핵심 컴포넌트”Reconciliation Cycle 전체 흐름:

- API Server: 다른 외부 시스템과 interact하기 위한 API를 제공하며, Application, repository, cluster credential, 인증 및 RBAC 관련 API를 제공한다.
- Repository Server: k8s manifest file이 있는 git repository의 로컬 Cache를 유지하며, git repo에서 manifest 정보를 가져올 때 호출된다.
- Application Controller: 배포된 application의 state와 정의된 desired state를 계속해서 비교하여 동기화되지 않을 때마다 API Server에 report한다.
기본 설치 시 생성되는 resources:
NAME READY UP-TO-DATE AVAILABLEdeployment.apps/argocd-application-controller 1/1 1 1# 인증 용 dex serverdeployment.apps/argocd-dex-server 1/1 1 1deployment.apps/argocd-redis 1/1 1 1deployment.apps/argocd-repo-server 1/1 1 1# UIdeployment.apps/argocd-server 1/1 1 1Argo CD Key Objects
섹션 제목: “Argo CD Key Objects”이번 프로젝트에서는 단일 Kubernetes Cluster 기반 Argo CD를 구성했으며, Project/ApplicationSets 등의 고급 기능은 활용하지 않았다. Kubernetes Utilities 관리를 위한 Argo CD Init과, Application Manifests 기반 배포를 위한 Argo CD Apps로 구분해서 관리했다.

- Application: 배포하고자 하는 application의 instance를 나타내는 k8s CRD. 생성할 application의 K8s manifest가 있는 git repo, 배포 대상 k8s server, namespace 등을 정의한다.
- App Project: 쿠버네티스의 namespace와 비슷한 개념으로 여러 App을 논리적인 project로 구분하기 위해 사용한다. Project별로 배포 가능한 k8s Object를 제한할 수도 있고, Sync Scheduling 기능으로 특정 시각에 배포하도록 할 수도 있다.
- Repo Credentials: repository 접근을 위한 credential로, Argo CD는 git url을 argocd-cm ConfigMap에 저장하고 credential이 담긴 secret을 사용한다.
- Cluster Credentials: Argo CD가 설치된 cluster가 아닌 다른 cluster에 접근할 때 사용된다.
Kubernetes Utilities 배포 관리를 위한 Argo CD 구성 예시
섹션 제목: “Kubernetes Utilities 배포 관리를 위한 Argo CD 구성 예시”Helm + Kustomize 및 Argo CD 기반 AKS Utilities 배포 구성 예시다. 기존에는 helm chart repository 관리 및 helm upgrade 기반 release를 활용하는 방식이 일반적이었으나, 이번 프로젝트에서는 Helm + Kustomize 및 Argo CD 기반 배포 구성으로 전환했다.

Argo CD 애플리케이션을 Kubernetes 클러스터에 배포하는 역할을 하며, GitHub Actions를 통해 수동으로 실행할 수 있고 kustomize 및 Argo CD CLI를 활용해서 배포를 진행한다. Inputs는 다음과 같다.
| 입력값 | 설명 | 필수 여부 | 선택 옵션 |
|---|---|---|---|
| cluster | 대상 Kubernetes 클러스터 | ✅ | aks-az01-dev-platform-01 |
| argocd_app | 대상 Argo CD 애플리케이션 | ✅ | app-routing-system, arc-runner, arc-system, argocd-apps, cert-manager, db-tools, digger, external, platform-apps |
| runner | 실행할 GitHub Runner | ✅ | arc-runner-platform |
Workflow Steps는 GitOps manifests repository 체크아웃 → Kustomize 설치 → Kustomize build로 리소스 준비 → Argo CD CLI 설치 및 로그인 → Argo CD 애플리케이션 생성(upsert) → Argo CD 애플리케이션 동기화 순서로 진행된다.
- name: Checkout GitOps manifests repository uses: actions/checkout@v4.2.2
- name: Setup kustomize uses: imranismail/setup-kustomize@v2
- name: Update Kubernetes Resources with New Docker Image Tag run: | kustomize build --enable-helm ./clusters/${{ inputs.cluster }}/${{ inputs.argocd_app }}/
- name: Set-up Argo CD CLI run: | curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64 sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd rm argocd-linux-amd64
argocd login --grpc-web --insecure --plaintext ${{ vars.ARGOCD_SERVER }} \ --username ${{ secrets.ARGOCD_ADMIN_USER }} \ --password ${{ secrets.ARGOCD_ADMIN_PASS }}
- name: Create Argo CD Application run: | argocd app create ${{ inputs.argocd_app }} --upsert \ --path clusters/${{ inputs.cluster }}/${{ inputs.argocd_app }}/ \ --repo ${{ env.ARGOCD_REPO }} \ --dest-server ${{ env.ARGOCD_DEST_SERVER }} \ --sync-option ServerSideApply=true
- name: Sync Argo CD Application run: | argocd app sync --retry-limit 3 \ ${{ inputs.argocd_app }}전체 Workflow manifest:
name: Argo CD Init Workflowrun-name: (${{ inputs.cluster }}/${{ inputs.argocd_app }}) Deploy Argo CD Application by @${{ github.actor }}
on: workflow_dispatch: inputs: cluster: description: "Target k8s cluster name" required: true type: choice options: - aks-az01-dev-platform-01 argocd_app: description: "Target argocd applicatoin name" required: true type: choice options: - '=== select ===' - app-routing-system - arc-runner - arc-system - argocd-apps - cert-manager - db-tools - digger - external - platform-apps runner: required: true type: choice options: - arc-runner-platform # - ubuntu-latest
permissions: id-token: write contents: read
env: ARGOCD_REPO: "https://github.com/example-org/platform-argocd-init.git" ARGOCD_DEST_SERVER: "https://kubernetes.default.svc"
jobs: argocd_sync: name: Deploy Argo CD Application runs-on: "${{ inputs.runner }}"
steps:
- name: Checkout GitOps manifests repository uses: actions/checkout@v4.2.2
- name: Setup kustomize uses: imranismail/setup-kustomize@v2
- name: Update Kubernetes Resources with New Docker Image Tag run: | kustomize build --enable-helm ./clusters/${{ inputs.cluster }}/${{ inputs.argocd_app }}/
- name: Set-up Argo CD CLI run: | curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64 sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd rm argocd-linux-amd64
argocd login --grpc-web --insecure --plaintext ${{ vars.ARGOCD_SERVER }} \ --username ${{ secrets.ARGOCD_ADMIN_USER }} \ --password ${{ secrets.ARGOCD_ADMIN_PASS }}
- name: Create Argo CD Application run: | argocd app create ${{ inputs.argocd_app }} --upsert \ --path clusters/${{ inputs.cluster }}/${{ inputs.argocd_app }}/ \ --repo ${{ env.ARGOCD_REPO }} \ --dest-server ${{ env.ARGOCD_DEST_SERVER }} \ --sync-option ServerSideApply=true
- name: Sync Argo CD Application run: | argocd app sync --retry-limit 3 \ ${{ inputs.argocd_app }}실행 예시로 Run workflow를 통해 다음 값을 입력하면 platform-apps 애플리케이션이 aks-az01-dev-platform-01 클러스터에 배포된다.
- cluster: aks-az01-dev-platform-01
- argocd_app: platform-apps
- runner: arc-runner-platform
마치며
섹션 제목: “마치며”Git branch 전략, Self-hosted Runner, GitOps 배포는 개별 도구로만 보면 익숙하지만, 실제 운영에서는 이 셋을 하나의 흐름으로 조합하는 지점에서 설계 고민이 많이 발생한다. 다음 편에서는 이 Tool Chain 위에서 실제 Application CI/CD Pipeline을 어떻게 설계하고, Build Cache와 Test 자동화를 어떻게 통합했는지를 다룬다.
Argo CD 기반 delivery와 Utility 배포 구조를 정리했다. 이 글로 DevOps Tool Chain 소시리즈가 완료된다.