How to setup ArgoCD on a Local K8s Cluster?

How to setup ArgoCD on a Local K8s Cluster?

Prerequisites:

  • Docker

  • Kubectl

Setup:

  1. Create a namespace for ArgoCD: kubectl create namespace argocd

  2. Apply the ArgoCD installation manifest: kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

  3. Check the status of the pods: kubectl get pods -n argocd

  4. Port forward the ArgoCD server: kubectl port-forward svc/argocd-server -n argocd 8080:443

  5. Retrieve the initial admin password: kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

  6. Install the ArgoCD CLI by following the instructions at: argo-cd.readthedocs.io/en/stable/cli_instal..

  7. Patch the ArgoCD server service to use a LoadBalancer type: kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'

  8. Get the external IP of the ArgoCD server: kubectl get svc argocd-server -n argocd

  9. Log in to ArgoCD CLI using the localhost: argocd login localhost

  10. Update the admin password: argocd account update-password

  11. Add the Docker Desktop cluster: argocd cluster add docker-desktop

  12. List the applications: argocd app list

  13. Set the current context namespace to argocd: kubectl config set-context --current --namespace=argocd

  14. Add an application from the CLI: argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default

  15. List the applications again: argocd app list

References: