Overview

The master instance is the main instance which controls the applications or the containers on the cluster. Don't forget: kubernetes consists of at least 1 master and 2 node. In total 2 machines which can run the application.

So let's initialize the cluster from the master instance:

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

Now, you can see that the cluster is saying that the cluster isn't Ready. But what that means, let's see which part isn't ready:

Check cluster components

So which podnetwork, we will use. As already mentioned if you are using Kubernetes >1.16, then you cannot use the weave network. Because of that I have used the Calico:

Apply Calico Pod network

After that we can check the components again:

Check cluster components

We see they are being Initialized as well: “Init:0/3”, so give them little time to start up. During that time the machine can be very slow, so have little patience. In the end you will see something like that:

Check cluster components

That concludes the initialization of the cluster. In the next section we will discuss how to add new nodes :)