Reputation: 79
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.
Upvotes: 7
Views: 1217
Reputation: 493
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.
Upvotes: 7
Reputation: 565
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/
Upvotes: -1