Overview

Kubernetes is the new mind breaking technology of Google and it is very close to Docker. In fact you need docker to run Kubernetes as well. So you can say that Kubernetes is based on Docker. So let's get it going. We will use 3 machines:

1 Master

2 Nodes (not slaves or workers)

To configure our kubernetes, we have to install the following:

Docker (or rkt) - Container runtime.

Kubelet - Kubernetes Node Agent.

Kubeadm - The tool used to build the cluster.

Kubectl - The Kubernetes Client

CNI - Install support for CNI network (Container network Interface / Spec or Model for Kubernetes Network)

Installation

To install the packages we have to:

Configure the Repos

Actuall install the packages.

So let's get going :)

Configure the Repos

The repo is configured very easy using the following script:

Repo Config

Please bare in mind, this is for Ubuntu Xenial 64. If you have different distribution please adjust….the last entry :)

Please run this command on all 3 machines.

Install the packages

So let's install the packages now:

Install packages

Please execute that on all 3 machines

Initiliaze the cluster

To initialize the cluster, we have to take two factors into consideration:

Which will be the advertise IP ?

Which will be the network which we will use for the pods.

The first question is pretty easy. Just use the network which is assigned to your master. In our case, we have 1 master and 2 noides. So we will assign the advertise IP of the master:

master - 192.168.50.10

node1 - 192.168.50.11

node2 - 192.168.50.12

The second question however, depends on the network which will be used for the pods. In our example I have used calico, because of the reasons listed below.Thus, our pod network by default is: 192.168.0.0/16.

So let's see how our commands

Initialize the cluster

After that, we have to perform a couple commands from the user, which will be responsible for the kubernetes and won't be root. (P.S. usage of root for applications is STRONGLY DISCOURAGED because of security stuff :) )

So just transfer it using the instructions above:

Execute as normal User

Once we have done that, we can check the cluster:

Check the cluster

Configure the network

Now, when you install If you have higher version than 1.16, you cannot use weave network anymore. In our example I have used calico 3.8.