From ae1bd9517868c5f214cf4359e75968f9986b6a1a Mon Sep 17 00:00:00 2001 From: Jashwanth Date: Fri, 26 Jun 2026 11:22:52 +0530 Subject: [PATCH] =?UTF-8?q?feat:=20ArgoCD=20GitOps=20setup=20=E2=80=94=20W?= =?UTF-8?q?eek=2010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - k8s/argocd/namespace.yaml: argocd namespace - k8s/argocd/crms-application.yaml: ArgoCD Application CRD - source: github.com/crms-devops/crms main branch k8s/base/ - auto-sync enabled: prune + selfHeal - CreateNamespace: true - docs/week-10-argocd-setup.md: setup guide GitOps flow: push to GitHub → ArgoCD auto-deploys to EKS --- docs/week-10-notes.md | 41 ++++++++++++++++++++++++++++++++ k8s/argocd/crms-application.yaml | 23 ++++++++++++++++++ k8s/argocd/namespace.yaml | 6 +++++ 3 files changed, 70 insertions(+) create mode 100644 docs/week-10-notes.md create mode 100644 k8s/argocd/crms-application.yaml create mode 100644 k8s/argocd/namespace.yaml diff --git a/docs/week-10-notes.md b/docs/week-10-notes.md new file mode 100644 index 0000000..98a8f7f --- /dev/null +++ b/docs/week-10-notes.md @@ -0,0 +1,41 @@ +# Week 10 — ArgoCD GitOps Setup + +## What ArgoCD does +ArgoCD watches your GitHub repo. When anything in k8s/base/ changes, +it automatically applies those changes to the EKS cluster. +No more manual kubectl apply. + +## To Install ArgoCD +winget install -e --id argoproj.argocd + +The official Argo CD CLI documentation also lists WinGet as a supported installation method. + +## I got this!! +PS C:\Projects\crms> argocd version --client +argocd: v3.4.4+443415b + BuildDate: 2026-06-18T09:15:00Z + GitCommit: 443415b5527ac55366e0760c93ef0e1abd0cf273 + GitTreeState: clean + GoVersion: go1.26.0 + Compiler: gc + Platform: windows/amd64 + +## Install ArgoCD on cluster +kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml + +## Access ArgoCD UI +kubectl port-forward svc/argocd-server -n argocd 8080:443 + +## Get initial admin password +kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d + +## Deploy CRMS Application +kubectl apply -f k8s/argocd/crms-application.yaml + +## GitOps flow after setup +1. Developer pushes code to GitHub +2. GitHub Actions builds new Docker image, pushes to GHCR +3. GitHub Actions updates image tag in k8s/base/backend-deployment.yaml +4. ArgoCD detects change in Git +5. ArgoCD automatically syncs to EKS cluster +6. New pods roll out with zero downtime \ No newline at end of file diff --git a/k8s/argocd/crms-application.yaml b/k8s/argocd/crms-application.yaml new file mode 100644 index 0000000..3be9b98 --- /dev/null +++ b/k8s/argocd/crms-application.yaml @@ -0,0 +1,23 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: crms + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://github.com/crms-devops/crms.git + targetRevision: main + path: k8s/base + destination: + server: https://kubernetes.default.svc + namespace: crms + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true \ No newline at end of file diff --git a/k8s/argocd/namespace.yaml b/k8s/argocd/namespace.yaml new file mode 100644 index 0000000..28e81d7 --- /dev/null +++ b/k8s/argocd/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: argocd + labels: + app: argocd \ No newline at end of file