Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

20 — GitOps Platform with ArgoCD

Status Stack

Full GitOps loop: git push → GitHub Actions builds image → ArgoCD auto-syncs Kubernetes cluster. Zero manual kubectl apply.

GitOps Flow

[Developer] git push
        ↓
[GitHub: app-code repo]
        ↓ GitHub Actions CI
        │  1. Build Docker image
        │  2. Push to GHCR
        │  3. Update image tag in manifests repo
        ↓
[GitHub: k8s-manifests repo]  ← Single source of truth
        ↓ ArgoCD watches (poll every 3 min)
        ↓
[k3s / EKS Cluster]
        ↓ ArgoCD detects diff → auto-sync
        ↓ Health check passes
        ↓ Telegram: "✅ Deployed flask-api:v1.2.3"

Two-Repo Strategy

Repo 1: 20_gitops_platform_argocd    ← App code + CI
├── app/
│   ├── main.py
│   └── requirements.txt
├── Dockerfile
└── .github/workflows/
    └── ci.yml      ← builds image, updates manifest repo via API

Repo 2: 20_gitops_manifests          ← GitOps source of truth
├── apps/
│   ├── flask-api/
│   │   ├── base/
│   │   │   ├── deployment.yaml
│   │   │   ├── service.yaml
│   │   │   └── kustomization.yaml
│   │   └── overlays/
│   │       ├── dev/
│   │       │   └── kustomization.yaml  ← image: flask-api:dev
│   │       └── prod/
│   │           └── kustomization.yaml  ← image: flask-api:v1.2.3
│   └── redis/
│       └── base/
└── argocd/
    ├── app-of-apps.yaml        ← 1 ArgoCD app manages ALL apps
    └── projects.yaml           ← ArgoCD project RBAC

ArgoCD App-of-Apps Pattern

# argocd/app-of-apps.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: app-of-apps
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/TamNguyenmeomeo/20_gitops_manifests
    targetRevision: main
    path: argocd/
  destination:
    server: https://kubernetes.default.svc
  syncPolicy:
    automated:
      prune: true
      selfHeal: true   # ← auto-corrects drift

Quick Start

# 1. Install ArgoCD
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# 2. Access ArgoCD UI
kubectl port-forward svc/argocd-server -n argocd 8080:443

# 3. Get admin password
kubectl -n argocd get secret argocd-initial-admin-secret \
  -o jsonpath="{.data.password}" | base64 -d

# 4. Deploy App of Apps
kubectl apply -f argocd/app-of-apps.yaml

Deliverables Checklist

  • ArgoCD installed on k3s via Helm
  • Two-repo structure (code + manifests)
  • App-of-Apps pattern managing all services
  • Full flow: git push → deployed in < 3 min
  • Rollback demo: revert Git commit → ArgoCD reverts
  • Kustomize overlays: dev + prod environments
  • ArgoCD Notifications → Telegram on sync failure
  • ArgoCD UI screenshot in README
  • Demo video showing full GitOps loop

About

GitOps deployment platform configuration using ArgoCD, App-of-Apps pattern, and Kustomize overlays.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages