In this tutorial, I’ll take you through the steps to install minikube on Ubuntu 18.04. To those new to minikube, let’s start with an introduction before diving to the installation steps.
Minikube is an open source tool that was developed to enable developers and system administrators to run a single cluster of Kubernetes on their local machine. Minikube starts a single node kubernetes cluster locally with small resource utilization. This is ideal for development tests and POC purposes,
In a nutshell, Minikube packages and configures a Linux VM, then installs Docker and all Kubernetes components into it.
Minikube supports Kubernetes features such as:
- DNS
- NodePorts
- ConfigMaps and Secrets
- Dashboards
As of this writing, Minikube does not yet support Cloud Provider specific features such as:
- LoadBalancers
- PersistentVolumes
- Ingress
Hypervisor choice for Minikube:
Minikube supports both VirtualBox and KVM hypervisors. This guide will cover both hypervisors.
Step 1: Update system
Run the following commands to update all system packages to the latest release:
sudo apt-get update sudo apt-get install apt-transport-https sudo apt-get upgrade
Step 2: Install KVM or VirtualBox Hypervisor
For VirtualBox users, install VirtualBox using:
sudo apt install virtualbox virtualbox-ext-pack
KVM Hypervisor Users
For those interested in using KVM hypervisor, check our guide on how to Install KVM on CentOS 7 / Ubuntu 16.04 / Debian 9 / SLES 12 / Arch Linux.
Then follow How to run Minikube on KVM instead.
Step 3: Download minikube
You need to download the minikube binary. I will put the binary under /usr/local/bin directory since it is inside $PATH.
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 chmod +x minikube-linux-amd64 sudo mv minikube-linux-amd64 /usr/local/bin/minikube
$ minikube version minikube version: v0.28.0
Step 4: Install kubectl on Ubuntu 18.04
We need kubectl which is a command line tool used to deploy and manage applications on Kubernetes
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
Add Kubernetes apt repository:
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
Update apt index and install kubectl
sudo apt update sudo apt -y install kubectl
Check version:
Step 5: Starting minikube
Now that components are installed, you can start minikube. VM image will be downloaded and configure d for Kubernetes single node cluster.
$ minikube start Starting local Kubernetes v1.10.0 cluster... Starting VM... Downloading Minikube ISO 150.53 MB / 150.53 MB [============================================] 100.00% 0s Getting VM IP address... Moving files into cluster... Downloading kubeadm v1.10.0 Downloading kubelet v1.10.0 Finished Downloading kubeadm v1.10.0 Finished Downloading kubelet v1.10.0 Setting up certs... Connecting to cluster... Setting up kubeconfig... Starting cluster components... Kubectl is now configured to use the cluster. Loading cached images from config file.
Wait for the download and setup to finish then confirm that everything is working fine.
Step 6: Minikube Basic operations
To check cluster status, run:
$ kubectl cluster-info Kubernetes master is running at https://192.168.39.117:8443 KubeDNS is running at https://192.168.39.117:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
~/.minikube/machines/minikube/config.json
To View Config, use:
$ minikube stop
To delete a local kubernetes cluster, use:
$ minikube delete
Step 7: Enable Kubernetes Dashboard
Kubernete ships with a web dashboard which allows you to manage your cluster without interacting with a command line. The dashboard addon is installed and enabled by default on minikube.
$ minikube dashboard
To get the URL of the dashboard
$ minikube dashboard --url http://192.168.39.117:30000
Access Kubernetes Dashboard by opening the URL on your favorite browser. For further reading, check:
- Hello Minikube Series: https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/
- Minikube guides for newbies: https://kubernetes.io/docs/getting-started-guides/minikube/