简体   繁体   中英

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.

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.

EC2 instances are used as a backend for kubernetes in the AWS cloud. You can always run necessary number of instances manually and deploy any service above.

The following article describes how to launch your EC2 instance: http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/getting-started-launch-instance.html

By the way, Amazon already provides a managed service similar to kubernetes based on docker. I will suggest you to consider using it. More information here: https://aws.amazon.com/ecs/details/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM