Minikube is a tool that lets you run Kubernetes clusters locally, which can be especially useful for learning and development purposes. Minikube runs a single-node Kubernetes cluster on your personal computer so that you can try out Kubernetes, or test your cloud-native applications.
This article will guide you through installing Minikube on Ubuntu, using Docker as the driver. Docker allows you to run your Kubernetes cluster in containers.
Prerequisites:
- A system running Ubuntu.
- User with sudo privileges.
- Stable Internet connection.
Step 1: Update the System
First, ensure your system package index is up-to-date:
sudo apt update && sudo apt upgrade -y
Step 2: Install Docker
If you haven’t installed Docker, you can install it by running:
sudo apt install -y docker.io
Start Docker and enable it to run at system startup:
sudo systemctl start docker
sudo systemctl enable docker
Step 3: Install Minikube
To install Minikube, first, download the latest binary using wget:
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Make the downloaded file executable:
chmod +x minikube-linux-amd64
Move the executable file to the /usr/local/bin directory:
sudo mv minikube-linux-amd64 /usr/local/bin/minikube
Step 4: Start Minikube with Docker Driver
Now, you are ready to start Minikube with the Docker driver. Run the below command:
minikube start --driver=docker
This will create a Minikube cluster using Docker. It will download the necessary Docker images and start the single-node cluster.
Step 5: Verify the Installation
Once the setup is complete, you can check the status of your Minikube cluster:
minikube status
The command above should show the host, kubelet, and apiserver components as running if the installation is correct.
Step 6: Interact with Your Cluster
You can now interact with your cluster using the kubectl command-line tool. For example, to get the details of your cluster nodes, run:
kubectl get nodes
This command will enable the dashboard addon and open the proxy in the default web browser.