Argo CD is a declarative continuous delivery tool for Kubernetes. It can be used as a standalone tool or as a part of your CI/CD workflow to deliver needed resources to your clusters.
In order to manage infrastructure and application configurations aligned with GitOps, your Git repository must be the single source of truth. The desired state of your system should be versioned, expressed declaratively, and pulled automatically. This is where Argo CD comes in.
-
Install Docker Desktop for Apple Silicon from here.
-
Run Docker Desktop, click on the "Settings" button on top right and enable Kubernetes as depicted in the image below:
-
Then enter the commands below in your terminal for Non High Availability (Non HA) setup:
minikube start kubectl create ns argocd kubectl apply -n argocd https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml kubectl get pods -n argocd
The result of the commands should look like:
-
ArgoCD can be used now and one can start deploying applications.
By default ArgoCD is not exposed (with external endpoint) outside the cluster. Expose it by using:
- LoadBalancer
- Change the argocd-server service type to LoadBalancer if managed Kubernetes services are used in cloud (AWS, Azure etc.)
- Ingress: Use your preferred ingress controller
- Create and ingress resource that point into argocd-server service
- Port-forward: it is simply used to access ArgoCD locally on your machine
-
Port-forwarding will be used to access ArgoCD Web UI locally
kubectl port-forward svc/argocd-server -n argocd 8080:443
-
Get the initial admin password by using the command below:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
The result of the commands should look like:
The decoded admin password is w68SPMKlm1lIC60q.
Now if you open your browser and enter https://localhost:8080/. Just bypass the https warning and go to the web page. It should show the login page of ArgoCD Web UI now. Enter "admin" as username and your decoded password to access the Web UI as shown below:
After logging in successfully you should see the homepage of the ArgoCD Web UI as shown below:
-
There are 3 options to interact with ArgoCD
- CLI
- Web UI
- Rest/gRPC API
-
CLI is useful when you need to interact with ArgoCD in CI/CD pipelines. You can manage everything by using it such as:
- Managing applications
- Managing repos
- Managing clusters
- Managing projects
- Doing administrative tasks etc.
-
ArgoCD CLI can be installed into all platforms. In order to install it on Mac, the below command can be used:
brew install argocd
-
After installing it, it is needed to login to ArgoCD Server before using any commands. The login command is as follows:
argocd login <ARGOCD_SERVER>
In order to login to the locally running instance enter the command below in your terminal:
argocd login localhost:8080
It will prompt to enter username and password. They are the same as the ones that you used to login to the Web UI. Enter those values and it will login.
-
After successful login, you can try using commands like:
argocd cluster list