In kubernetes whether it is possible to create cross region cluster in aws?

3/9/2020

Is there any possible to create master node in one region and worker node in another region in AWS ? If yes can someone Please tell how or if no can anyone give reason for that

-- HARINI NATHAN
amazon-web-services
kubernetes

2 Answers

3/9/2020

It would be possible but on-prem only and not by using cloud.

So in short: it is impossible to use nodes from different regions in a single AWS cluster.

However it is still possible to run clusters in multiple zones:

Kubernetes 1.2 adds support for running a single cluster in multiple failure zones (GCE calls them simply “zones”, AWS calls them “availability zones”, here we’ll refer to them as “zones”).

Multizone support is deliberately limited: a single Kubernetes cluster can run in multiple zones, but only within the same region (and cloud provider).

I hope it helps.

-- OhHiMark
Source: StackOverflow

3/9/2020

If you are deploying your own kubernetes cluster then yes it's possible to create EC2 instances in one region as master nodes and EC2 instances in another region as worker nodes. Just that you need to ensure they are reachable by ensuring security groups, public IPs for EC2 instances or VPC peering etc.

Edit:

One thing to note is when you do kubeadm init on master node you need to add public IP of master node as a parameter because otherwise kubeadm will only generate certificate for private IP of master node.

kubeadm init --apiserver-cert-extra-sans=PUBLIC-IP-OF-MASTER-NODE --control-plane-endpoint=PUBLIC-IP-OF-MASTER-NODE

Once you do this the certificate genearated will be valid for Public IP of the master node and you should be able to join a worker node using the public IP of master node.

Verify that the IP that you are using to kubeadm join is listed in X509v3 Subject Alternative Name: section of the certificate using command in master node.

openssl x509 -in /etc/kubernetes/pki/apiserver.crt -text -noout
-- Arghya Sadhu
Source: StackOverflow