| name | argocd-cli |
| description | ArgoCD CLI operations for GitOps workflows — installation, bootstrap, and day-2 management. USE FOR: ArgoCD install, ArgoCD bootstrap, GitOps sync, ArgoCD app create, ArgoCD troubleshoot, ApplicationSet. DO NOT USE FOR: Helm chart management (use helm-cli), kubectl operations (use kubectl-cli), CI/CD pipeline creation (use @devops). |
When to Use
- Install ArgoCD on AKS cluster
- Bootstrap app-of-apps pattern
- ArgoCD application management
- Sync status verification and drift detection
- Repository credential configuration
Prerequisites
- kubectl access to target cluster
- Helm 3.12+ installed
- ArgoCD CLI installed (for day-2 operations)
- GitHub credentials for repository access
Installation & Bootstrap
1. Install ArgoCD via Helm
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
kubectl create namespace argocd
helm install argocd argo/argo-cd \
--namespace argocd \
--values deploy/helm/argocd/values.yaml \
--wait --timeout 10m
kubectl get pods -n argocd
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=argocd-server -n argocd --timeout=300s
2. Get Initial Admin Password
kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath="{.data.password}" | base64 -d; echo
argocd login argocd.${DNS_ZONE_NAME} --username admin --password <password>
3. Configure Repository Credentials
kubectl apply -f argocd/repo-credentials.yaml
argocd repo add https://github.com/${GITHUB_ORG}/agentic-devops-platform.git \
--username <username> --password <github-token>
argocd repo list
4. Bootstrap App-of-Apps
kubectl apply -f argocd/app-of-apps/root-application.yaml
kubectl apply -f argocd/sync-policies.yaml
argocd app list
5. Configure External Secrets Integration
kubectl apply -f argocd/secrets/cluster-secret-store.yaml
kubectl apply -f argocd/apps/external-secrets.yaml
kubectl apply -f argocd/apps/gatekeeper.yaml
Day-2 Operations
Authentication
argocd login <ARGOCD_SERVER> --username admin --password <password>
argocd context
Application Operations
argocd app list
argocd app get <app-name>
argocd app diff <app-name>
argocd app sync <app-name>
argocd app sync <app-name> --prune
argocd app get <app-name> --hard-refresh
Health & Status
argocd app get <app-name> -o json | jq '.status.health.status'
argocd app get <app-name> -o json | jq '.status.sync.status'
argocd app resources <app-name>
Troubleshooting
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-server --tail=100
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-application-controller --tail=100
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-repo-server --tail=100
argocd app sync <app-name> --force
kubectl get events -n argocd --sort-by='.lastTimestamp'
Project Files Reference
- Helm values:
deploy/helm/argocd/values.yaml
- App-of-apps:
argocd/app-of-apps/root-application.yaml
- Sync policies:
argocd/sync-policies.yaml
- Repo credentials:
argocd/repo-credentials.yaml
- Secret store:
argocd/secrets/cluster-secret-store.yaml
- Terraform module:
terraform/modules/argocd/
Best Practices
- ALWAYS diff before sync
- Use --prune carefully in production
- Verify health after sync
- Use projects for access control
- Enable auto-sync only for non-prod environments
- Configure notifications for sync failures
- Use sync waves for ordered deployments
Output Format
- Command executed
- Sync/health status
- Any drift detected
- Recommended actions
Integration with Agents
Used by: @devops, @sre