Installing Minikube on Linux
Install Minikube on Linux , Ubuntu, and Server
Overview
Before learning about Minikube, we should at least know about Kubernetes, because Minikube is one kind of Kubernetes that is commonly used.
Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. In other words, Kubernetes is a container manager that manages several containers to serve at one end and prevents the service from being down or overloaded by weighing all loads and balancing them throughout all containers at the same time. Put simply, Kubernetes is a multi-service manager.
Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node (node = machine/server). Minikube is available for Linux, macOS, and Windows systems. Minikube is the simplest and easiest-to-use type of Kubernetes if you have only one single server to run.
Prerequisites
- A server running on one of the following operating systems: Ubuntu 22.04, 20.04, 18.04, 16.04 or any other Debian-based distribution like Linux
- It’s recommended that you use a freshly installed OS to prevent any unexpected issues
- Access to the root user
Installation Steps
1. Installing Docker
In this article, we will be using Docker container as a base for Minikube. In case Docker is not installed
sudo apt-get install docker.io -y
sudo usermod -aG docker $USER && newgrp docker
2. Updating system packages and installing Minikube dependencies
sudo apt update & sudo apt upgrade
sudo apt install -y curl wget apt-transport-https
3. Installing Minikube
Use the following curl command to download the latest Minikube binary:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Once the binary is downloaded, copy it to the path /usr/local/bin and set the executable permissions on it
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Verify the minikube version
minikube version
#output
minikube version: v1.32.0
commit: 8220a6eb95f0a4d75f7f2d7b14cef975f050512d
Note: At the time of writing this tutorial, the latest version of minikube was v1.32.0
4. Installing kubectl utility
kubectl is a command line used to interact with Kubernetes cluster. It is used for managing deployments, replica sets, services, etc. Use the following command to download the latest version of kubectl.
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
Once Kubectl is downloaded, set the executable permissions on the Kubectl binary and move it to the path /usr/local/bin.
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
Now verify the kubectl version
kubectl version -o yaml
5.Start minikube
As we stated in the beginning, we would be using docker as base for minikue, so start Minikue with the docker driver and run
minikube start --driver=docker
Perfect! The above picture confirms that the Minikube cluster has been confluenced and started successfully.
6. Verifying Installation
Run the below minikube command to check the status.
minikube status
#output
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
Run the following kubectl command to verify the Kubernetes version, node status, and cluster info.
kubectl cluster-info
Kubernetes control plane is running at https://192.168.49.2:8443
CoreDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 3m27s v1.30.0
7. Managing Addons on minikube
By default, only a couple of addons are enabled during minikube installation. To see the addons in Minikube, run the below command.
minikube addons list
If you wish to enable any addons, run the below minikube command.
minikube addons enable metrics-server
Let’s assume we want to enable and access the Kubernetes dashboard. Run
minikube dashboard
Use localhost output
Server use this commands
minikube dashboard --url
Follow next order
Run the command in background
kubectl proxy --address='0.0.0.0' --disable-filter=true &
#output
W0423 04:59:24.539492 15291 proxy.go:177] Request filter disabled, your proxy is vulnerable to XSRF attacks, please be cautious
Starting to serve on [::]:8001
Follow next order
Use server IP and port [::]:8001 and use url /api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/
http://server_ip:8001/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/workloads?namespace=default
Simplifying Kubernetes Service Management: A Step-by-Step Guide
Enjoy it! 🍻 That’s It; we are done...
For seamless Cloud Management incorporating DevOps as the core of the methodology, reach out to us at info@cypik.com
About the author:
My name is Suresh Yadav, and I am an experienced Linux enthusiast and DevOps engineer. I’m passionate about automating and streamlining development processes, and currently, I work as a DevOps Engineer at Cypik. I specialize in cloud technologies, with a focus on the Google Cloud Platform (GCP).