Creating multi-node and multi-cloud Kubernetes cluster

Kubernetes:

Amazon Web Service :

Microsoft Azure

Let’s start..

yum install docker -y
systemctl start docker
systemctl enable docker
vim /etc/docker/daemon.json {
"exec-opts": ["native.cgroupdriver=systemd"]
}
systemctl restart docker
vim /etc/yum.repos.d/k8s.repo [kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
yum install kubeadm kubectl kubelet -y
systemctl enable --now kubelet
kubeadm config images pull
yum install iproute-tc -y
vim /etc/sysctl.f/k8s.conf 
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
kubeadm init --control-plane-endpoint "PUBLICIP:PORT" --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=NumCPU --ignore-preflight-errors=Mem

pod-network-cidr= IP range for pods inside the slave nodes

Control plane endpoint = assign the cluster with a public IP with port

ignore-preflight-errors= Ignoring the unwanted CPU errors and memory errors

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -fhttps://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

Generating Token:

kubeadm token create --print-join-command

🔰 Slaves Configuration:

yum install iproute-tc    #Installing iproute-tcyum install docker -y  #Install Docker vim /etc/docker/daemon.json     #Changing the driver
{
"exec-opts": ["native.cgroupdriver=systemd"]
}
systemctl restart docker #Restart dockersystemctl enable --now docker #enable Docker#Kubernetes Repository
vim /etc/yum.repos.d/k8s.repo [kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
#Installing the required packages
yum install kubeadm kubectl kubelet -y
#Enabling kubelet service
systemctl enable --now kubelet

#Configure the iptables /etc/sysctl.d/k8s.confvim /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
sysctl --system
kubeadm token create --print-join-command
kubectl get nodes