Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Multi-Cloud Multi-Node Kubernetes Cluster
Piyush Bagani
Piyush Bagani

Posted on

     

Multi-Cloud Multi-Node Kubernetes Cluster

Hello Readers😁

In this particular blog, I am going to set up Multi-Node Kubernetes Cluster on Multi-Cloud.

What I mean by this? Ans Why Multi-Cloud ?

  • According to a Survey, 81% of organizations are working with two or more public cloud providers.

  • A multi-cloud strategy gives companies the freedom to use the best possible cloud for each workload.

How to configure Multi-Cloud Multi-Node Kubernetes Cluster?

Here I am going to set up 1 Master Node in AWS Cloud and 1-1 Slave Node in AWS and Azure respectively.

In one of previous blogs I had describedHow to Set Up Multi-Node Kubernetes Cluster Over AWS using Ansible. There I created 1 master and 1 slave in AWS cloud. In the Same manner to setup nodes in AWS, I will be using Ansible.To know more about Ansible and How did I do that set up, Visit to that blog.(inline Linked above)

After running the playbook to launch instances on AWS,we can check the AWS EC2 management console. Two instances are launched with the tag names Master and Slave respectively.
alt text
Further I created the roles for Master and Slave respectively. You can visit my previous blog for more info.

Now I am going to set up 1 Slave Node in Azure Cloud. Here I am manually setting up the Slave node in Azure.

  • Create a virtual Machinealt text
  • Choose the authentication type as password and give the required user-name and Password

alt text

You can add the inbound rule and outbound rule and allow all the ports afterwards by going in networking section.
alt text

Now you can follow the following steps in Azure :

  • Install docker and enable it.

yum install docker -y
systemctl enable docker --now

  • Configuring Docker cgroup diver as systemd

vim /etc/docker/daemon.json{
"exec-opts":["native.cgroupdriver=systemd"]
}

  • Restart docker and enable it

systemctl restart docker
systemctl enable docker --now

  • Configuring kubernetes repo

vim /etc/yum.repos.d/kubernetes.repo

Write this in above file

[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.gpghttps://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
-Now you can install kubadm , kubelet and kubectl

yum install -y kubelet kubeadm kubectl — disableexcludes=kubernetes

  • Enabling kubelet service

systemctl enable kubelet --now

  • Install iproute-tc and configure IPtable

yum install iproute-tc

  • GO to this file

vim /etc/sysctl.d/k8s.conf

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

  • Key point: In Azure Podman is already Pre-installed so remove Podman and install docker

Podman remove command: yum remove podman

  • Now, our slave is ready to join. Go to master node and print the join command.

kubeadm token create --print-join-command

  • Finally get the nodes in master and you will see slave1 and slave2 is joined with master and a cluster is formed.alt text

Following is theGithub Repository for your reference

Connect with me onLinkedIn

I hope you got something New out of it.

Thanks For Reading.

Keep Learning, Keep Hustling🎯🎯

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Cloud Engineer | Tech Enthusiast | 3 x Google Cloud | 2 x AWS | Terraform Associate | KCNA | | RHCSA | Automating and Optimizing Cloud Infrastructures for Efficiency and Scalability
  • Location
    Ahmedabad,Gujarat,India.
  • Education
    Bachelor of Engineering
  • Work
    Cloud Engineer
  • Joined

More fromPiyush Bagani

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp