Setting up Kubernetes Clusters using Kubeadm Manual way in RHEL 7 / Centos7

Spread the Knowledge

What is Kubeadm?

Kubeadm helps you bootstrap a minimum viable Kubernetes cluster that conforms to best practices. Kubeadm is a tool built to provide kubeadm init and kubeadm join as best-practice “fast paths” for creating Kubernetes clusters.

Goal

  • To Install a single master Kubernetes cluster
  • To Install a high availability master Kubernetes cluster
  • To Install a Pod network on the cluster so that your Pods can talk to each other.

kubeadm’s simplicity means it can serve a wide range of use cases:

  • New users can start with kubeadm to try Kubernetes out for the first time.
  • Users familiar with Kubernetes can spin up clusters with kubeadm and test their applications.
  • Larger projects can include kubeadm as a building block in a more complex system that can also include other installer tools.

Pre-requisite

  • One or more machines running a deb/rpm-compatible OS, for example Ubuntu or CentOS
  • 2 GB or more of RAM per machine. Any less leaves little room for your apps.
  • 2 CPUs or more on the master
  • Full network connectivity among all machines in the cluster. A public or private network is fine

As part of the installation, every node (master and minions) needs:

  • Docker
  • Kubelet
  • Kubeadm
  • Kubectl
  • CNI

Step 1 – Change Mac Address in Virtual box -> Setting -> Network ->Advance

Step 2 – Change Host Name

Step 3 – Stop and Disable Firewall

Step 4 – Disable swap

Step 5 – Setup yum repo for kubelet kubeadm kubectl

Step 6 – Set SELinux in permissive mode (effectively disabling it)

Step 7 – Install kubelet kubeadm kubectl and enable kubelet

Step 8 – Finally, initialize a kubernetes clusters

Step 9 – Output

Step 10 – Setup Workstation in the Master node only. You can be regular user for it.

Step 11 – Verify Clustors

Step 12 – Install Kubernetes pod networking

Weave Net provides networking and network policy, will carry on working on both sides of a network partition, and does not require an external database. Kubernetes versions 1.6 and above:

Step 13 – Setup nodes [ In the node aka worker ]