Create a Multi-Cloud Setup of Kubernetes cluster ⚑🎑

Task Description πŸ“„

Master node on AWS, Slave nodes on AWS, Azure and GCP.

Let’s start :

First : Setting up Kubernetes master on AWS :

vim /etc/yum.repos.d/k8s.repo# content inside repo 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 docker kubelet kubeadm kubectl iproute-tc -y
systemctl enable --now docker
systemctl enable --now kubelet
kubeadm config  images pull
vim /etc/docker/daemon.json{  
"exec-opts": ["native.cgroupdriver=systemd"]
}
systemctl restart docker
echo "1" > /proc/sys/net/bridge/bridge-nf-call-iptable
--control-plane-endpoint=<PUBLIC_IP>:6443kubeadm init --pod-network-cidr=10.244.0.0/16 --control-plane-endpoint=<public_ip>:6443 --ignore-preflight-errors=NumCPU          --ignore-preflight-errors=Mem
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 -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubeadm token create --print-join-command

Second : Setting up Kubernetes nodes on AWS, Azure, GCP :

vim /etc/yum.repos.d/k8s.repo# content inside repo 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 docker kubelet kubeadm kubectl iproute-tc -y
systemctl enable --now docker
systemctl enable --now kubelet
kubeadm config  images pull
vim /etc/docker/daemon.json{  
"exec-opts": ["native.cgroupdriver=systemd"]
}
systemctl restart docker
echo "1" > /proc/sys/net/bridge/bridge-nf-call-iptable

Finally, in master node :

kubectl get nodes

Task Completed Successfully !!

Thanks for Reading !! πŸ™ŒπŸ»πŸ˜πŸ“ƒ

πŸ”° Keep Learning !! Keep Sharing !! πŸ”°

πŸš€ Feel free to connect with me :

Arth Learner - LinuxWorld Informatics Pvt Ltd