24-Kubernetes Cluster Setup
24-Kubernetes Cluster Setup
-> Create 3 virtual machines using Ubuntu 20.04 version AMI by selecting above
security group
#Load modules:
#Install containerd:
#Disable swap:
$ sudo swapoff -a
# Install Kubernetes packages (Note: If you get a dpkg lock message, just wait a
minute or two before trying the command again):
Initialize the Kubernetes cluster on the control plane node using kubeadm
(Note: This is only performed on the Control Plane Node):
Note: if we will get an error as "[ERROR NumCPU]: the number of available CPUs 1 is
less than the required 2"
Kubeadm runs a series of pre-flight checks to validate the system state before
making changes.
This error means the host don't have minimum requirement of 2 CPU.
You can ignore the error if you still want to go ahead and install kubernetes on
this host.
$ mkdir -p $HOME/.kube
In the Control Plane Node, create the token and copy the kubeadm join command
(NOTE:The join command can also be found in the output from kubeadm init command):
In the Control Plane Node, view cluster status (Note: You may have to wait a few
moments to allow all nodes to become ready):
=====================================================
Validate the setup by executing below command in master-node
======================================================
$ kubectl get nodes