Bootstrapping docker deamon

8/8/2016

In the official Kubernetes multinode Docker guide , it is mentioned that you need to another Docker instance:

A bootstrap Docker instance which is used to start etcd and flanneld, on which the Kubernetes components depend

So what is a bootstrap instance and how do you make sure that keeps running on restarts ?

-- KarateKid
docker
kubernetes

1 Answer

8/8/2016

The documentation gives a detailed explanation as to the purpose of the bootstrap instance of Docker:

This guide uses a pattern of running two instances of the Docker daemon: 1) A bootstrap Docker instance which is used to start etcd and flanneld, on which the Kubernetes components depend 2) A main Docker instance which is used for the Kubernetes infrastructure and user’s scheduled containers

This pattern is necessary because the flannel daemon is responsible for setting up and managing the network that interconnects all of the Docker containers created by Kubernetes. To achieve this, it must run outside of the main Docker daemon. However, it is still useful to use containers for deployment and management, so we create a simpler bootstrap daemon to achieve this.

In summary the special bootstrap docker daemon runs the bits that kubernetes depends on, freeing up the the normal docker daemon to be managed by kubernetes. This is a trick that leverages the fact that both etcd and flanneld can be run as containers. Alternatively one would have to set them up locally as services.

As for ensuring the bootstrapping docker daemon survives a restart, the answer lies within the code. Here's where it's being called when running the master.sh script.

So the code attempts to setup a service for the extra docker daemon process.

-- Mark O'Connor
Source: StackOverflow