Difficulty: beginner
Estimated Time: 10 minutes

In this scenario, we will setup a kubernetes cluster with one node and one master. We will use a utility called kubeadm for that.

Setup a kubernetes cluster with kubeadm

Step 1 of 2

Setup a master

Setting a kubernetes master

Setting up cluster using kubeadm requires kubeadm, kubectl and kubelet to be installed. Here we have all of them installed. You can check steps for installation here.

We are goint to pull images for various components kube-apiserver, kube-controller-manager, kube-scheduler, etcd used by kubernetes master node by executing command kubeadm config images pull.

Now we have pulled images and we can initiate master node creation using kubeadm init --pod-network-cidr=192.168.0.0/16.

When kubeadm init finishes we need to execute following instructions as mentioned in kubeadm init output.

mkdir -p $HOME/.kube

cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

chown $(id -u):$(id -g) $HOME/.kube/config

We need to setup a networking for kubernetes. We will use a provider called flannel. Install it using a command kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml. There are more such providers available for use. You can check entire list at kubernetes container networking.

Terminal Host 2