HA Kubernetes cluster with Vagrant+CoreOS+Ansible, Part 3

HA Kubernetes cluster with Vagrant+CoreOS+Ansible, Part 3

In part 2 we have installed etcd clusters on the 3 master machines, which is the foundation of the Kubernetes cluster. In this part, we’re gonna configure and run kubelet on each nodes. kubelet is the primary node agent that manages pods on each nodes and talks to the Kubernetes api server to coordinate the whole system.

Prepare the certs and keys for kubelet

The first thing we do is to prepare the certs and keys required by kubelet for authentication and authorisation and generate a kubeconfig file to be passed in as parameter.

Add the following code in the VagrantFile behind the ETCD part, the full content VagrantFile can be found at here.

Create kubelet as a service

To make sure kubelet runs on all nodes and be able to survive system restarts, we make it as a system service and enable it. Create the following template file containing the service definition for kubelet