5

I'm a bit confused about how aws EKS works, excuse me for my ignorance. I have 4 VPC's one for shared services(gitlab ect..), one for dev, one for staging and one for prod. There are multiple subnets on each vpc for different clients a,b,c. Currently I just have pipelines that build images and deploy on an ec2 in a specific vpc/subnet. The pipeline ssh to the server based on gitlab-ci file.

I would like to change that and have a k8 cluster, where when the image updates the k8 deploys my image to the specified vpc and subnets. I know I can hook up my registry to the k8 and have it work on update thats not my question. My question is how does EKS work across VPC's and subnets.

Is this possible. It seems like the EKS cluster can only be in 1 vpc and can only deploy to those subnets?

Am I not understanding correctly?

bink1time
  • 383
  • 1
  • 5
  • 15
  • 1
    I haven't tested this. Technically you should be able to create worker nodes in other VPCs, they just need to have routing to the Control Plane endpoint in the cluster's VPC via any of the peering options. Managed Node Groups won't work because the cluster only lets us select subnets from the original VPC, but in general custom nodes will work. That being said, I wouldn't use the same cluster for different envs unless the app is really tiny. If you're already separating VPC's for envs, doubtful that using the same control plane is a good idea. You'll need to tag subnets for elb controller. – Tamir Daniely Jan 12 '22 at 17:23

1 Answers1

4

You are correct.

EKS ControlPlane can only be running in a single VPC and can be associated with subnets in that VPC.

I have raised feature requests while back with AWS to support multi VPC and multi region EKS but no news about them so far.

marcincuber
  • 3,451
  • 1
  • 17
  • 29