Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating kubernetes cluster inside an existing VPC in AWS

To create kubernetes cluster in AWS, I use the set up script "https://get.k8s.io". That script creates a new VPC automatically, but I want to create kubernetes cluster inside an existing VPC in AWS. Is there a way to do it?

I checked /kubernetes/cluster/aws/config-default.sh file, but there doesn't seem to be any environment variables about VPC.

like image 227
H.S. Avatar asked Feb 02 '16 09:02

H.S.


People also ask

Can I deploy EKS to a dedicated VPC?

However, if you have them in your VPC, you can deploy self-managed nodes and Kubernetes resources to these types of subnets. The subnets must use IP address based naming. Amazon EC2 resource-based naming isn't supported with Amazon EKS. The subnets can be a public or private.

Can you have a VPC within a VPC?

Yes. Instances in one region can communicate with each other using Inter-Region VPC Peering, public IP addresses, NAT gateway, NAT instances, VPN Connections or Direct Connect connections.

What is the recommended way to create an EKS cluster?

Create an Amazon EKS cluster. You can create a cluster by using eksctl , the AWS Management Console, or the AWS CLI. Version 0.120. 0 or later of the eksctl command line tool installed on your device or AWS CloudShell.


1 Answers

You can add this ENV variable (we are using ver 1.1.8)

export VPC_ID=vpc-YOURID

Also Kubernetes creates a VPC with 172.20.0.0/16 and I think it expects this.

like image 93
Tal G. Avatar answered Oct 21 '22 09:10

Tal G.