How to Install ArgoCD on Minikube and Deploy an App

In this article on we are going to cover Install Minikube on Ubuntu 22.04 LTS, How to Install ArgoCD on Minikube and Deploy an App on ArgoCD.

What is Minikube in Kubernetes?

Minikube creates a single node cluster inside a VM or Cloud Instance. It is good for beginners to learn Kubernetes since you don’t have to create a master and worker node to create a cluster and we can practice basic Kubernetes functions and can also install the Kubernetes dashboard on it.

Minikube System Requirements

  • Minimum 2 CPU’s or more    
  • Minimum 2GB of free memory    
  • Minimum 20GB of free disk space   
  •  Internet connection    
  • Container or virtual machine manager, such as: Docker, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware Fusion/Workstation

Step #1:Install Minikube on Ubuntu 22.04 LTS

Update the system packages on Ubuntu 22.04 LTS

sudo apt update -y

install below packages for minikube

sudo apt install curl wget apt-transport-https -y

Install Docker on Ubuntu 22.04 LTS

sudo apt install docker.io

Configure to Run docker without sudo permission

sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock

To check whether virtualization support is enabled on your machine or not

egrep -q 'vmx|svm' /proc/cpuinfo && echo yes || echo no

install the KVM and and other tools on Ubuntu 22.04 LTS

sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon

Add your user to libvert group

sudo adduser -a $USER libvirt
sudo adduser -a $USER libvirt-qemu

Reload Group:

newgrp libvirt
newgrp libvirt-qemu

To download latest minikube setup refer minikube official download page

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

Install Minikube on Ubuntu 22.04 LTS

sudo install minikube-linux-amd64 /usr/local/bin/minikube

To check minikube version on Ubuntu

minikube version

Output:

ubuntu@ip-172-31-32-58:~$ minikube version
minikube version: v1.32.0
commit: 8220a6eb95f0a4d75f7f2d7b14cef975f050512d
ubuntu@ip-172-31-32-58:~$

Step #2:Install kubectl on Minikube

Download kubectl binary with curl on Ubuntu using below command

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" 

Make the kubectl binary executable

chmod +x ./kubectl 

Make the kubectl binary executable

sudo mv kubectl /usr/local/bin/

To check kubectl version on Ubuntu

kubectl version --client --output=yaml

Output:

clientVersion:
  buildDate: "2023-10-18T11:42:52Z"
  compiler: gc
  gitCommit: a8a1abc25cad87333840cd7d54be2efaf31a3177
  gitTreeState: clean
  gitVersion: v1.28.3
  goVersion: go1.20.10
  major: "1"
  minor: "28"
  platform: linux/amd64
kustomizeVersion: v5.0.4-0.20230601165947-6ce0bf390ce3

Step #3:Start MiniKube on Ubuntu 22.04

Start the minikube Kubernetes cluster on Ubuntu

minikube start --vm-driver docker

output:

clientVersion:
  buildDate: "2023-10-18T11:42:52Z"
  compiler: gc
  gitCommit: a8a1abc25cad87333840cd7d54be2efaf31a3177
  gitTreeState: clean
  gitVersion: v1.28.3
  goVersion: go1.20.10
  major: "1"
  minor: "28"
  platform: linux/amd64
kustomizeVersion: v5.0.4-0.20230601165947-6ce0bf390ce3

ubuntu@ip-172-31-32-58:~$ minikube start --vm-driver docker
* minikube v1.32.0 on Ubuntu 22.04 (xen/amd64)
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* Updating the running docker "minikube" container ...

X Docker is nearly out of disk space, which may cause deployments to fail! (97% of capacity). You can pass '--force' to skip this check.
* Suggestion:

    Try one or more of the following to free up space on the device:

    1. Run "docker system prune" to remove unused Docker data (optionally with "-a")
    2. Increase the storage allocated to Docker for Desktop by clicking on:
    Docker icon > Preferences > Resources > Disk Image Size
    3. Run "minikube ssh -- docker system prune" if using the Docker container runtime
* Related issue: https://github.com/kubernetes/minikube/issues/9024

* Preparing Kubernetes v1.28.3 on Docker 24.0.7 ...
* Verifying Kubernetes components...
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: storage-provisioner, default-storageclass
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

To Check the status of Minikube

minikube status

Output:

minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

Step #4:Install ArgoCD on Minikube

There are several driver options that you can use to start a minikube cluster (virtualbox, docker, hyperv).

We are using driver as docker

minikube start --driver=docker

Just like other Kubernetes tools, ArgoCD requires a namespace with its name. Therefore, we will create a namespace for argocd.

kubectl create ns argocd

ArgoCD can be installed using its manifests. First, you’ll need to download these manifests and apply them to your Minikube cluster.

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

This will create the necessary resources for ArgoCD within the argocd namespace.

Let’s verify the installation by getting all the objects in the ArgoCD namespace.

kubectl get all -n argocd

Output:

How to Install ArgoCD on Minikube and Deploy an App 1

Step #5:Access ArgoCD UI on Browser

By default, the ArgoCD server is not exposed outside the cluster. You can expose it using port-forwarding to access the ArgoCD UI.

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

Output:

How to Install ArgoCD on Minikube and Deploy an App 2

The ArgoCD UI will be available at http://localhost/IP:8080. Access it through your web browser.

Now we can go to a browser and open instance_ip:8080

How to Install ArgoCD on Minikube and Deploy an App 3

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. (Your browser setting may present a different option to continue).

How to Install ArgoCD on Minikube and Deploy an App 4

Get the initial password for the admin user to log in

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
How to Install ArgoCD on Minikube and Deploy an App 5

Use the generated password to log in as the admin user in the ArgoCD UI.

We have covered Install ArgoCD on minikube.

Step #6:Deploying an app on ArgoCD

Now that we are in the user interface, we can create a new app. The source code for my application is in my Github repo, so We will connect my Github repo to ArgoCD.

After logging in, click the + New App button as shown below:

How to Install ArgoCD on Minikube and Deploy an App 6

Give your app the name guestbook, use the project default, and leave the sync policy as Manual:

How to Install ArgoCD on Minikube and Deploy an App 7

Connect the https://github.com/argoproj/argocd-example-apps.git repo to Argo CD by setting repository url to the github repo url, leave revision as HEAD, and set the path to guestbook:

How to Install ArgoCD on Minikube and Deploy an App 8

For Destination, set cluster URL to https://kubernetes.default.svc (or in-cluster for cluster name) and namespace to default:

How to Install ArgoCD on Minikube and Deploy an App 9

Click on Create after that you can see

How to Install ArgoCD on Minikube and Deploy an App 10

click on guestbook then you will see the result

How to Install ArgoCD on Minikube and Deploy an App 11

Click on Synchronize

How to Install ArgoCD on Minikube and Deploy an App 12
How to Install ArgoCD on Minikube and Deploy an App 13

Now we can App got deployed on ArgoCD.

Conclusion:

We have covered Install Minikube on Ubuntu 22.04 LTS, How to Install ArgoCD on Minikube and Deploy an App on ArgoCD.

Related Articles:

GitOps with ArgoCD Pipeline | How does ArgoCD Works

FOSS TechNix

FOSS TechNix (Free,Open Source Software's and Technology Nix*) founded in 2019 is a community platform where you can find How-to Guides, articles for DevOps Tools,Linux and Databases.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap