Run local kubernetes cluster

VirtualBox, Vagrant should be installed. It is simple.

Install kubectl (client to work with kubernetes cluster)

-- get current stable version (v1.14.1)
$ echo $(curl -sS

-- install
$ curl -LO$(curl -s && chmod +x kubectl && sudo mv kubectl /usr/local/bin/

Prepare hosts file

$ sudo vi /etc/hosts
# Kubernetes cluster
#--------------------------------------------------------------------- master.k8s master node1.k8s node1 node2.k8s node2

Run local kubernetes cluster

$ vagrant plugin install vagrant-hostmanager

$ mkdir ~/vagrant-kubernetes && cd ~/vagrant-kubernetes

# git clone .

$ cd vagrant-provisioning/

$ vagrant up

Copy special config file on host to manage cluster remotely

$ mkdir -p ~/.kube/config

// root password: kubeadmin
$ scp root@master:/etc/kubernetes/admin.conf ~/.kube/config

$ kubectl version --short
Client Version: v1.14.1
Server Version: v1.14.1

$ kubectl get nodes
master.k8s   Ready    master   14m     v1.14.1
node1.k8s    Ready    <none>   11m     v1.14.1
node2.k8s    Ready    <none>   9m34s   v1.14.1