简体   繁体   English

在AWS中的现有VPC内创建kubernetes集群

[英]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 ". 要在AWS中创建kubernetes集群,我使用设置脚本“ https://get.k8s.io ”。 That script creates a new VPC automatically, but I want to create kubernetes cluster inside an existing VPC in AWS. 该脚本自动创建一个新的VPC,但我想在AWS中的现有VPC中创建kubernetes集群。 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. 我检查了/kubernetes/cluster/aws/config-default.sh文件,但似乎没有关于VPC的任何环境变量。

You can add this ENV variable (we are using ver 1.1.8) 你可以添加这个ENV变量(我们使用的是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. 此外,Kubernetes创建了一个172.20.0.0/16的VPC,我认为它预计会这样。

EC2 instances are used as a backend for kubernetes in the AWS cloud. EC2实例用作AWS云中kubernetes的后端。 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 以下文章介绍了如何启动EC2实例: 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. 顺便说一句,亚马逊已经提供了类似于基于docker的kubernetes的托管服务。 I will suggest you to consider using it. 我建议你考虑使用它。 More information here: https://aws.amazon.com/ecs/details/ 更多信息: https//aws.amazon.com/ecs/details/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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