Steps to Install & Configure Minikube on Ubuntu 20.04 LTS

Minikube is a free & open source tool.It is used to set up a single-node Kubernetes cluster on local machine.It is easy to use tool & run a single node Kubernetes cluster on local machine for daily development work.Minikube supports the latest Kubernetes release,multiple container runtimes such as Containerd, KVM, Docker, Podman, Load balancing,filesystems mounts & CI environments.

There are some steps to Install & Configure Minikube on Ubuntu:

Requirements:

  • Ubuntu machine with Sudo Privileges.
  • 2 CPUs or more.

Step 1: Update the System.

apt-get update

Step 2: Install the required packages.minikube delete

apt-get install conntrack
apt install curl wget apt-transport-https virtualbox virtualbox-ext-pack

  • Here is the command output.
  • On License agreement appears screen.Select OK and then Enter to continue.

  • Select Yes for accept the terms of the VirtualBox PUEL license.

Step 3: Install Docker.

apt install docker.io

  • Start & Enable the docker.

systemctl start docker
systemctl enable docker

Step 4: Install Minikube on system.

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

  • Here is the command output.

  • Copy the downloaded folder to /usr/local/bin/.

cp minikube-linux-amd64 /usr/local/bin/minikube

  • Provide the following permission.

chmod 755 /usr/local/bin/minikube

  • Check the Minikube version.

minikube version

  • Here is the command output.

Step 5: Install Kubectl on system.

curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl

  • Here is the command output.

  • Provide execute permission.

chmod +x ./kubectl

  • Move the folder.

mv ./kubectl /usr/local/bin/kubectl

  • Check Kubectl version.

kubectl version -o json

  • Here is the command output.

Step 6: Start the Minikube.

minikube start --vm-driver=none

  • Here is the command output.minikube delete

  • To list the kubectl configuration.

kubectl config view

  • Here is the command output.
  • To display the cluster information.

kubectl cluster-info

  • Here is the command output.

  • To check running nodes.

kubectl get nodes

  • To list of all the Minikube pods.

kubectl get pod

  • To check Minikube status.

minikube status

  • Here is the command output.

  • To list all the container image running in the cluster.

kubectl get pods --all-namespaces

  • Here is the command output.

  • To list all addons.

minikube addons list

  • Here is the command output.

  • To enable any addons.

minikube addons enable <addon-name>

  • To enable Ingress controller addon,run the following command.

minikube addons enable ingress

  • Here is the command output.

  • To enable and access Kubernetes dashboard.

minikube dashboard --url

  • Here is the command output.

  • Copy the URL & open the Kubernetes dashboard on your browser.

Step 7: Test the Minikube.

  • To deploy nginx.

kubectl create deployment my-nginx --image=nginx

  • To check deployment status.

kubectl get deployments.apps my-nginx

  • Check pods.minikube delete

kubectl get pods

  • Here is the command output.

  • Expose the deployment.

kubectl expose deployment my-nginx --name=my-nginx-svc --type=NodePort --port=80
kubectl get svc my-nginx-svc

  • Here is the command output.

  • To get service URL.

minikube service my-nginx-svc --url

  • Here is the command output.

  • Run curl command to access nginx based deployment.

curl http://private-ip:31506

  • Here is the command output.

Step 8: Open Nginx web interface using Public Ip address.

http://server-ip:31506

  • Here is the command output.

Step 9: Stop & Delete the Minikube run the following commands.

  • For minikube stop,run

minikube stop

  • Here is the command output.

  • For minikube Delete,run

minikube delete

  • Here is the command output.

Leave a Reply

Your email address will not be published.