← All cheatsheets
$ argocd app listInstall Argo CD, log in, create and sync applications, roll back, and debug drift from the command line.
Install and log in
kubectl create namespace argocdCreate the namespace for Argo CDkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yamlInstall the latest stable Argo CDkubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -dGet the initial admin passwordkubectl port-forward svc/argocd-server -n argocd 8080:443Open the UI and API on localhost:8080argocd login localhost:8080 --username admin --insecureLog in with the CLIargocd account update-passwordChange the admin passwordApplications
argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace defaultCreate an app from a Git pathargocd app listList all applications and their statusargocd app get guestbookShow sync and health detailsargocd app diff guestbookCompare live state with Gitargocd app sync guestbookSync the app to the Git revisionargocd app wait guestbook --healthWait until the app is healthyargocd app history guestbookShow deployment historyargocd app rollback guestbook 3Roll back to history ID 3argocd app set guestbook --sync-policy automated --self-heal --auto-pruneTurn on auto sync, self heal and pruningargocd app delete guestbookDelete the app and its resourcesClusters, repos and projects
argocd cluster add my-contextRegister another cluster from your kubeconfigargocd cluster listList registered clustersargocd repo add https://github.com/org/repo.git --username git --password $TOKENAdd a private Git repoargocd repo listList repositoriesargocd proj listList projectsargocd proj create team-a -d https://kubernetes.default.svc,team-a -s https://github.com/org/*Create a project with allowed destination and sourceTroubleshooting
argocd app get guestbook --hard-refreshForce a fresh read from Gitargocd app manifests guestbookPrint the rendered manifestsargocd app logs guestbookStream logs from app podsargocd app terminate-op guestbookStop a stuck sync operationkubectl -n argocd logs deploy/argocd-repo-serverCheck manifest generation errorskubectl -n argocd logs statefulset/argocd-application-controllerCheck sync and health errorsApplication manifest
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: HEAD
path: guestbook
destination:
server: https://kubernetes.default.svc
namespace: guestbook
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true