How to Use ArgoCD?
Don’t get afraid because getting started with ArgoCD is simple. Wanna see how simple it is? Click, you won’t regret.
I installed ArgoCD, deployed the guestbook app, and then did something naughty: I changed the cluster by hand to see what ArgoCD does about it. The answer surprised me a little, because at first it did nothing — no suggestion, no warning and more importantly no reconciliation. Let me show you the whole thing.
Install ArgoCD
# namespace
kubectl create namespace argocd
# clone repo
# good to clone at /tmp because it's not part of your project
cd /tmp
git clone https://github.com/argoproj/argo-helm.git
cd argo-helm/charts/argo-cd
helm dependency up # downloads dependencies from Chart.yaml
# install
helm install argocd . --values values.yaml -n argocdVerify:
helm list -n argocdNAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
argocd argocd 1 2026-10-27 14:01:41.858028041 +0545 +0545 deployed argo-cd-10.11.6 v3.5.6Wait until all the pods are running:
kubectl get pods -n argocdOpen The UI
kubectl port-forward service/argocd-server -n argocd 8080:443Now open https://localhost:8080 in the browser. It will show a certificate warning, that is normal, ArgoCD is using a self-signed one.
| Field | Value |
|---|---|
| Username | admin |
| Password | Output of the command below |
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -dInstall The CLI
Go to the official release page and download the latest stable version for your OS. For example:
# for linux amd64 (x86_64)
VERSION=$(curl -L -s https://raw.githubusercontent.com/argoproj/argo-cd/stable/VERSION)
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/download/v$VERSION/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64Verify:
which argocd/usr/local/bin/argocdLog in (keep the port-forward running in another terminal):
argocd login localhost:8080 --username admin --insecureIt asks for the same admin password. After that:
argocd app listCreate An Application
You can create an application using kind: Application, the CLI or the UI, whatever you are comfortable with. The best way to start is this example repo. Let’s deploy the guestbook using YAML manifests, first from the UI:
Same thing using a YAML manifest:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook-ui
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/argoproj/argocd-example-apps
path: guestbook
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: default
syncPolicy:
automated:
prune: false
selfHeal: falseWarning
The Application object must live in the argocd namespace, that is the only place ArgoCD looks for it. The app’s own pods go to spec.destination.namespace (here default).
kubectl apply -f guestbook-ui.yaml
kubectl get app -n argocdNAME SYNC STATUS HEALTH STATUS
guestbook-ui Synced HealthyWatch the pods come up:
kubectl get pods -wNAME READY STATUS RESTARTS AGE
guestbook-ui-6d476cf4df-5z77t 0/1 ContainerCreating 0 37s
guestbook-ui-6d476cf4df-5z77t 1/1 Running 0 92sSync Policy Options
Those two false values in syncPolicy are the interesting part:
| Option | What It Does |
|---|---|
Auto Sync (automated) | When Git changes, ArgoCD applies it by itself |
| Prune | Resources you delete from Git also get deleted from the cluster |
| Self Heal | Changes made directly in the cluster are reverted back to Git |
Let’s Be Naughty
Git says 1 replica. I will change the cluster by hand to 2:
kubectl scale deployment guestbook-ui --replicas=2
kubectl get pods -wNAME READY STATUS RESTARTS AGE
guestbook-ui-6d476cf4df-5z77t 1/1 Running 0 14m
guestbook-ui-6d476cf4df-t5vxd 1/1 Running 0 5m31sI waited and nothing happened, even after 5m31s. The pod stayed. That is because I had only Auto Sync on. Auto Sync reacts when Git changes, and Git did not change. My change was in the cluster. The app just showed OutOfSync in the UI.
I got annoyed, so I turned on Self Heal (UI checkbox, or CLI):
argocd app set guestbook-ui --self-healNAME READY STATUS RESTARTS AGE
guestbook-ui-6d476cf4df-5z77t 1/1 Running 0 14m
guestbook-ui-6d476cf4df-t5vxd 1/1 Running 0 5m31s
guestbook-ui-6d476cf4df-t5vxd 1/1 Terminating 0 6m21s
guestbook-ui-6d476cf4df-t5vxd 0/1 Completed 0 6m22sAs soon as Self Heal was on, ArgoCD noticed 2 in the cluster but 1 in Git, and Git is the boss. The extra pod was gone.
flowchart LR
scale["Scale to 2 by hand"] --> auto["Auto Sync only"]
auto --> stay["Stays 2, shows OutOfSync"]
stay --> heal["Turn on Self Heal"]
heal --> back["Back to 1, same as Git"]
Clean Up
Delete the app using the CLI, because it also removes the resources the app created. If you use kubectl delete app, the guestbook pods stay behind.
argocd app delete guestbook-ui --yes
helm uninstall argocd -n argocd
kubectl delete namespace argocdHelm leaves the CRDs behind, so remove them too if you want a fully clean cluster:
kubectl delete crd applications.argoproj.io applicationsets.argoproj.io appprojects.argoproj.io