- Log in to the Argo CD server from the CLI
- Create an application from a Git repository
- Perform a manual sync and inspect status
- Enable automated sync, self-heal, and auto-prune
- Verify self-healing by making an intentional out-of-band change
This lesson uses an insecure CLI login with plaintext credentials for demonstration only. Do not use
--insecure or --plaintext in production.Prerequisites: the
argocd CLI and kubectl must be installed and configured to talk to the target cluster where Argo CD is running. The sample app repository used in this lesson is https://github.com/argoproj/argocd-example-apps.git.Quick reference: key commands
1) Log in to Argo CD via CLI
In this lab Argo CD is exposed on a NodePort atlocalhost:3000. Log in using the argocd CLI:
2) Create the application from the CLI
Create theweb-frontend application using the sample guestbook app repository:
applications namespace has no resources managed by Argo CD:
3) Sync the application
Perform a manual sync to apply the manifests from Git into the cluster:applications namespace:
4) Enable automated sync and self-heal
To make the application automatically reconcile differences and prune deleted resources, switch the sync policy to Automated and enable self-heal and auto-prune: Set automated sync policy:argocd app set --help. Example sync-related flags include:
5) Demonstrate self-heal by scaling the Deployment
To verify self-healing works, simulate an out-of-band change by scaling theguestbook-ui Deployment to 5 replicas:
6) Inspect Deployment events
Describe the Deployment to see events showing scale up and scale down actions. Note: when rendering MDX, literal XML/HTML-like tokens such as<none> must be written as inline code to avoid being parsed as JSX. The excerpt below uses the backticked escapes shown to ensure proper rendering.
<none> entries ensure MDX does not try to interpret angle-bracket content as JSX.)
7) Waiting for syncs
If a sync is in progress and you want to block until it finishes, useargocd app wait:
This completes a CLI-based workflow for creating Argo CD applications, syncing them, enabling automated reconciliation (self-heal and auto-prune), and validating self-healing behavior. For more detail and production best practices, see: