kubeadm – Setup kubenetes cluster on ubuntu 16.04

Before installing Kubernetes, you have to install dependencies of Kubernetes. You have to install those dependencies in all of the nodes that you will join in the Kubernetes cluster.

Installing Dependencies

The first piece to be installed is apt-transport-https (a package that allows using HTTPS well as HTTP in apt repository sources). You can install it with below commond

We gonna use Docker as container engine, so let’s install it with below command

Once Docker is installed, start and enable the Docker service with the commands

Here enable marks the service for starting up on boot, and start actually start the service immediately.

Install kubeadm

In the previous step, we have installed all the dependencies now install kubeadm.

Retrieve the key for the Kubernetes repo and add it to your key manager

Add the kubernetes repo to your system

Update repository list

All set, now Install kubelet, kubeadm, kubectl and kubernetes-cni (a package that enables cni network on your machine)

You need to do all the above steps on all of your machines that you want to run kubernetes

Initialize your master

To initialize the master, pick one of the machines you previously installed kubeadm on, and run:

you will get similar output in your terminal…

To make kubectl work for your non-root user, you might want to run these commands (which is also a part of the kubeadm init output):

Make a record of the kubeadm join command that kubeadm init outputs. You will need this in a moment.

Deploying a pod network

You must deploy a pod network before anything will actually function properly. I’ll demonstrate this by installing the Romana pod network. This can be done with two commands (run on the master):

You can check your current node status with command

Setup kubernetes on other node

Just do all the steps on the node but not kubeadm init and pod network setup and run the join command,

If you forgot the cluster token, you can generate a new one with the command:

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

I am Arjun from Hyderabad (India). I have been working as a software engineer from last 7+ years, and its my passion to learn new things and implement them as a practice. Aside from work, I likes gardening and spending time with pets.
DMCA.com Protection Status