Attaching vm to kubernetes nodes list

12/8/2018

I am using docker for mac with kubernetes integrated with it.

$kubectl get nodes
NAME                 STATUS    ROLES     AGE       VERSION
docker-for-desktop   Ready     master    13h       v1.10.3

I have a virtual node created using docker-machine with driver as virtual box (docker-machine create --driver virtualbox vm1)

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER     ERRORS
vm1    -        virtualbox   Running   tcp://192.168.99.100:2376           v18.09.0  

How can I attach vm1 to the kubernetes node list without using any other third party tool?

-- Shadab Hassan
docker
kubernetes
virtual-machine

1 Answer

12/8/2018

For a system to join a Kubernetes cluster it must have the Kubernetes node agent running on it, called the Kubelet.

Once you have installed the Kubelet on the node (how you do that depends on your VM's operating system) you will need to configure which API server it should communicate with.

However, with minikube (which is what Docker for Mac typically uses for Kubernetes) you are not typically able to create multi-node clusters. It is only designed for testing locally with a single Kubernetes node.

If you are looking for a solution to deploy a Kubernetes cluster across multiple nodes you should probably take a look at kubeadm.

If you want to deploy multi-node clusters using Docker then you will need a Docker Enterprise license.

-- chaosaffe
Source: StackOverflow