my net house

WAHEGURU….!

Install Vanilla Kubernetes Cluster on Ubuntu.

Here We are Installing Vanilla Flavour of Kubernetes Cluster(With High Availablility), Which is Small but Production-Ready.

 

Prerequisites:

 

  • You need to have at least Two VMs(Master Node and Slave Node)
  • Both VMs should connected on the Same Network.
  • Master Node must have 2 CPUs and at least 2 GB of RAM.
  • Swap must be turned OFF on Both of the VM(s).
  • A basic understanding of Linux, Networking and docker unless you are a magician. 😉

 

Installation Steps:

Run Following Command on Master Node.(Without Hash 😛 ) 
#  apt install docker.io

# systemctl enable docker

# apt install curl

# curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add

# apt-add-repository “deb http://apt.kubernetes.io/ kubernetes-xenial main”

# apt install kubeadm

After Running all the Commands above you would be able to Install All Kubernetes Packages on the Master Node.

Now you need to Deploy Cluster. Run Following Commands. 

 

# swapoff -a

#  hostnamectl set-hostname master-node

# kubeadm init –pod-network-cidr=10.244.0.0/16 (Look at it’s output Carefully!!)

# mkdir -p $HOME/.kube

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

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

 

 

Deploy Pod Network: (There are different Types of Networks you can use. Here we are using flannel)

 

$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

 

Add the slave node to the network in order to form a cluster. 

Run the Command which you will get in output after running this:
kubeadm init –pod-network-cidr=10.244.0.0/16” on you Master Node. make sure you have to run Command which will lokk like Following on Your Slave-node. So you can use Kubernetes Cluster. 

** Don’t Run Following Command as it is.

 

kubeadm join 172.31.9.252:6443 –token bixhtx.4bqyhe45g8fvhqeq \

    –discovery-token-ca-cert-hash sha256:eb5f21bfda175f8d60ca50780941df83169893182c8fd2073de32daccc7b2e6d

 

Other Comman Kubernetes commands to Play with your Cluster:

# kubectl get nodes

# kubectl get pods –all-namespaces

 

Enjoy your Cluster!! 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: