You had your first k8s master server, now it’s time to setup our nodes and connect them.

Let’s start on Kube1 (

$ sudo su
  • Disable swap
$ swapoff -a

Also don’t forget to disable swap on reboot, by edit /etc/fstab file

  • (Optional) Set hostname
$ hostnamectl set-hostname kube1
  • (Optional) Set static IP

Edit file /etc/netplan/50-cloud-init.yaml to set static IP

    renderer: networkd
            dhcp4: no
            addresses: []
                addresses: [,]
    version: 2
  • Update apt
$ apt update
  • Install Docker
$ apt install

Auto start Docker

$ systemctl enable docker

Start Docker

$ systemctl start docker
  • Install Kubeadm
$ curl -s | apt-key add

$ apt-add-repository "deb kubernetes-xenial main"

$ apt install kubeadm
  • Join this node to the master

This command was generated when you setup your Master server

$ kubeadm join xxx:6443 --token xxx --discovery-token-ca-cert-hash xxx
  • (Optional) Docker registry

As I told, for some funny security reasons, Docker doesn’t want to connect to an insecure registry.

To allow Docker to use insecure registry, you need to:

Edit file /etc/docker/daemon.json

        "insecure-registries" : [""]

Edit file /etc/default/docker


Restart Docker

$ service docker restart

Repeat the same, for Kube2 (don’t forget the hostname and static IP)

Now you have a working k8s cluster with Master and 2 Nodes!

In the final chapter, we will build our infrastructure on this cluter. And trust me, it’s not harder than playing with Lego blocks

…To be continued

Final chapter: