Skip to content
EgyKode
09 · GitOps deliveryLab 48 / 59
Guided labgitops

GitOps Delivery with Argo CD: Sync, Drift & Self-Heal

Deploy by changing Git, then break the cluster by hand and watch Argo CD put it back.

Time
45 min
Level
Intermediate
Objectives
6 objectives
Cost
Low cost

Where this fits in the platform

This lab adds

  • A cluster that follows Git, and reverts anything applied by hand

Which lets you

Before you start

You will need

  • The EKS cluster and ECR repository from the earlier labs
  • kubectl, and access to the Git repository holding your manifests
  • Argo CD, installed in step 1

You do not need these already — the lab environment below provides them.

You will be able to

  • Deploy by changing desired state rather than by running commands against a cluster
  • Read an Argo CD diff and say which side is wrong
  • Recognise drift, and know which direction reconciliation resolves it

CostLow cost

Assumes the EKS cluster from the earlier labs is already running — this adds only Argo CD itself, which is a handful of Pods on nodes you are already paying for. If the cluster is not up, that is the ~$0.30/hour, not this.

Nothing to pay in the browser. Open the terminal runs this against a simulated cloud — the same API calls and the same commands, with no account and no bill. The figure above applies only if you build it in your own.

How to clean up

What this lab is for#

Every lab up to here ended with you applying something. This one takes that away. From now on the cluster is not something you change — it is something that follows a change you make somewhere else.

The pipeline you built already stops one step short of deploying: its last stages update a manifest and push a commit. This lab is what happens next.

text
Jenkins
   |  8 Update manifest    (the image tag in kustomization.yaml)
   |  9 Push manifest
   v
Git repository            <-- the desired state
   |
   v
Argo CD                   <-- notices, compares, applies
   |
   v
Kubernetes

Hands-on environment

Run this lab in a real terminal, free and in your browser. The environment is temporary and yours alone — break it as much as you like.

Open the terminal

Opens in Killercoda, in a new tab — keep this page open for the steps.

Run it on your own machine

Run this lab on your own machine. One command starts the environment, with everything the lab needs already installed:

Argo CD reconciles a kind cluster exactly as it does EKS. Point the Application at your own repository and use a locally built image in the kustomization instead of the ECR reference.

You will need:

  • docker
  • kubectl
  • kind
git clone https://github.com/Waleeddarwesh/EgyKode-lab.git
cd EgyKode-lab
./egykode start k8s
./egykode shell

You need Docker and Git installed. Everything else runs inside the environment. The first start downloads it and takes a few minutes; later starts are seconds.

Not sure what you already have? Run: npm run doctor — it checks and changes nothing.

Run it on AWS

This lab builds real cloud infrastructure, so it needs your own AWS account. Follow the cost and cleanup notes above — the resources are yours, and so is the bill.

Anything you tick here is your own record. EgyKode cannot see inside that terminal, so the success criteria stay self-assessed even when the environment checks your work for you.

Install Argo CD and look at what it is

Step 1 of 7

Clean up#

Deleting the Application is what removes the workloads — and only because of the finalizer you set in step 2. Without it you delete the record and leave everything it created running, which is a genuinely expensive mistake on a cluster you are paying for.

DestructiveThis removes real resources. Check which environment you are in first.

Terminal
kubectl delete application ivolve-app -n argocd   # cascades via the finalizer
kubectl get all -n ivolve                         # must be empty — verify, do not assume
helm uninstall argocd -n argocd && kubectl delete ns argocd

If kubectl get all -n ivolve still shows Pods, the cascade did not happen. Check the finalizer was present before the delete; recreating the Application and deleting it again is the tidiest recovery.

The EKS cluster itself is untouched by this lab — destroy it with terraform destroy when you finish for the day, as always.


What you added to the platform#

Before this lab, something still had to run kubectl — and that something needed cluster credentials. Now nothing does. The pipeline's authority ends at a commit, and the authority to change the cluster lives inside the cluster.

That is a security property as much as a workflow one, and it is the last piece of the delivery chain: an image built once, scanned, pushed immutably, referenced by a manifest, and deployed by reconciliation.

Maintained by others, on Killercoda. Useful for extra repetition on one tool — it does not complete this lab or settle any criterion above.

Success criteria

0 of 6

The concept behind it

Ready to try it without help?Do the challenge

Phase complete · 09 GitOps delivery

You can now: A version deploys because Git changed, and a change you make by hand does not survive.

Next phase

Lab 48 of 59 on the project path

10 · ObservabilityDeploying Kube-Prometheus-Stack on AWS EKSGet metrics out of the cluster and into Grafana, so 'is it healthy' has an answer that is not a guess.31 minAdvanced

Previous: GitHub Actions: Build, Scan and Deploy to EKS