Installing ArgoCD on Minikube

Installing ArgoCD on Minikube

In this article I will explain how to install and setup ArgoCD on a minikube cluster.

What is ArgoCD?

Argo CD is a Kubernetes-native continuous deployment (CD) tool. Unlike external CD tools that only enable push-based deployments, Argo CD can pull updated code from Git repositories and deploy it directly to Kubernetes resources. It enables developers to manage both infrastructure configuration and application updates in one system.

Argo CD offers the following key features and capabilities:

  • Manual or automatic deployment of applications to a Kubernetes cluster.

  • Automatic synchronization of application state to the current version of declarative configuration.

  • Web user interface and command-line interface (CLI).

  • Ability to visualize deployment issues, detect and remediate configuration drift.

  • Role-based access control (RBAC) enabling multi-cluster management.

  • Single sign-on (SSO) with providers such as GitLab, GitHub, Microsoft, OAuth2, OIDC, LinkedIn, LDAP, and SAML 2.0

  • Support for webhooks triggering actions in GitLab, GitHub, and BitBucket.

What is minikube?

Minikube is a utility you can use to run Kubernetes (k8s) on your local machine. It creates a single node cluster contained in a virtual machine (VM). This cluster lets you demo Kubernetes operations without requiring the time and resource-consuming installation of full-blown K8s.

Many of you are using minikube for your development work in k8s so this blog will help you setting up ArgoCD in your minikube cluster.


Prerequisite:

You require minikube installed in your system already.

Enter below command to start the minikube cluster( my driver is docker). I will be explaining setting up ArgoCD on minikube in this story.

minikube start

Step 1.

Create a namespace argocd in your cluster. In argocd namespace all your argocd related pods and services will run.

kubectl create ns argocd

Step 2.

Now, we will apply the ArgoCD manifest installation file from ArgoCD Github Repo.

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Step 3.

To verify the installation get the pods running in argocd namespace using:

kubectl get pods -n argocd

Here the Pods are just starting up.

After the installation all your pods will be in running state in argocd namespace.

Step 4.

After the installation get your credentials to login to your ArgoCD application. Default username is admin and default password is stored as a secret in your argocd namespace; ; therefore, we will use jsonpath query to retrieve the secret from the argocd namespace. We also need to decode it with base64. Linux users can use the below command. Windows users can skip the command after the pipe and use a online website to decode the base64 code.

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

Step 5.

Now we will login to ArgoCD application. To login to app we need to expose the service. We will use port-forwarding for that. In the terminal type:

kubectl port-forward svc/argocd-server -n argocd --address 0.0.0.0  8081:443

Now you can go to either http://localhost:8081 orhttp://{your-ip}:8081 in your browser to access your ArgoCD WebGUI.

⚠️⚠️ WARNING ⚠️⚠️

DO NOT CLOSE THE PORT-FORWARDING TERMINAL. You will loose your connection to WebGUI if you do so.

You will see a privacy warning. Just ignore the warning, click on Advanced and then hit on Proceed to localhost (unsafe) to continue to the GUI interface.

The username is admin and password is what you got in the Step 4.

Step 6.

🎉 Congratulations you have completed this tutorial.

You have now successfully installed ArgoCD in your minikube cluster successfully.

Congratulations GIFs | Tenor


Extra:

If you want to delete the complete ArgoCD setup run:

kubectl delete  -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

🚨🚨 CAUTION 🚨🚨

The above command will delete your whole ArgoCD application in your argocd namespace.