Running Kubernetes locally on Linux with Minikube - now with Kubernetes 1.14 support
Author:
A few days ago, the Kubernetes community announced Kubernetes is a real winner (and a de facto standard) in the world of distributed Cloud Native computing. While it can handle up to
A few weeks ago I ran a poll on Twitter asking the community to specify their preferred option for running Kubernetes locally on Linux: Ok, Twitter ✋ This is post #1 in a series about the local deployment options on Linux, and it will cover Minikube, the most popular community-built solution for running Kubernetes on a local machine.
Minikube is designed to be used as a virtual machine (VM), and the default VM runtime is
By default, Minikube uses Virtualbox as a runtime for running the virtual machine. Virtualbox is a cross-platform solution, which can be used on a variety of operating systems, including GNU/Linux, Windows, and macOS. At the same time, QEMU/KVM is a Linux-native virtualization solution, which may offer benefits compared to Virtualbox. For example, it's much easier to use KVM on a GNU/Linux server, so you can run a single-node Minikube cluster not only on a Linux workstation or laptop with GUI, but also on a remote headless server. Unfortunately, Virtualbox and KVM can't be used simultaneously, so if you are already running KVM workloads on a machine and want to run Minikube there as well, using the KVM minikube driver is the preferred way to go. In this guide, we'll focus on running Minikube with the KVM driver on Ubuntu 18.04 (I am using a bare metal machine running on
This is not an official guide to Minikube. You may find detailed information on running and using Minikube on it's official
NOTE: skip if already installed Before we proceed, we have to verify if our host can run KVM-based virtual machines. This can be easily checked using the
If you receive the following output after running Now let's install KVM and libvirt and add our current user to the After installing libvirt, you may verify the host validity to run the virtual machines with NOTE: skip if already installed In order to manage the Kubernetes cluster, we need to install
The recommended way to install it on Linux is to download the pre-built binary and move it to a directory under the
Your local Kubernetes cluster on Linux is deployed by:Disclaimer
Prerequisites
libvirt
and QEMU-KVM installed and properly configuredkubectl
) for operating the Kubernetes clusterQEMU/KVM and libvirt installation
sudo apt install cpu-checker && sudo kvm-ok
kvm-ok
, you can use KVM on your machine (otherwise, please check out your configuration):$ sudo kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
libvirt
group to grant sufficient permissions:sudo apt install libvirt-clients libvirt-daemon-system qemu-kvm \
&& sudo usermod -a -G libvirt $(whoami) \
&& newgrp libvirt
virt-host-validate
tool, which is a part of libvirt.sudo virt-host-validate
kubectl (Kubernetes CLI) installation
$PATH
.curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
&& sudo install kubectl /usr/local/bin && rm kubectl