How to configuring Kubernetes on the Master node only

Here you could find a guide, on How to Install Kubernetes on Master and Worker nodes

Configure kubeadm.

kubeadm config images pull

Open the necessary ports used by Kubernetes.

firewall-cmd --zone=public --permanent --add-port={6443,2379,2380,10250,10251,10252}/tcp 

Allow docker access from another node, replace the worker-IP-address with yours.

firewall-cmd --zone=public --permanent --add-rich-rule 'rule family=ipv4 source address=worker-IP-address/32 accept' 

Allow access to the host’s localhost from the docker container.

firewall-cmd --zone=public --permanent --add-rich-rule 'rule family=ipv4 source address= accept' 

Make the changes permanent.

firewall-cmd --reload

Install CNI (container network interface) plugin for Kubernetes.

For this setup, we’ll be using Calico

Issue the following command:

kubeadm init --pod-network-cidr

You should see something like the example below. Make note of the discovery token, it’s needed to join worker nodes to the cluster.

Note that the join token below is just an example.

kubeadm join --token 4xrp9o.v345aic7zc1bj8ba \ --discovery-token-ca-cert-hash sha256:b2e459930f030787654489ba7ccbc701c29b3b60e0aa4998706fe0052de8794c 

Make the following directory and configuration files.

mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f

Enable pod to run on Master. This is only for demonstration purposes and is not recommended for production use.

kubectl taint nodes --all

Check that the Master node has been enabled and is running.

kubectl get nodes

The output should be

master  NotReady  master   91s     v1.18.0

On successful execution, you should see a node with ready status. If not, wait a moment and repeat the command.

When the Master node is up and running, continue with the next section to join the Worker node to the cluster.

Here you will find a guide, on How to configuring Kubernetes on the Worker node only

Warning: file_get_contents([YOUR SITE URL]): failed to open stream: Connection refused in /var/www/vhosts/ on line 821