在 AWS 中创建 Kubernetes - ap-northeast-2 区域抛出错误 "Please specify AWS_IMAGE directly (region not recognized)"

Kubernetes creation in AWS - ap-northeast-2 region throws error "Please specify AWS_IMAGE directly (region not recognized)"

在 AWS 云 ap-northeast-2 区域创建 Kubernetes 集群时抛出 "Please specify AWS_IMAGE directly (region not recognized)" 消息。

通过设置区域 "export KUBE_AWS_ZONE="ap-northeast-2a"" 进行了尝试。但是还是创建失败。

[root@ip-172-31-29-160 cluster]# export KUBE_AWS_ZONE="ap-northeast-2a"
[root@ip-172-31-29-160 cluster]# ./kube-up.sh
*********************************************************
ZONE: ap-northeast-2a
REGION: ap-northeast-2
*********************************************************
... Starting cluster using provider: aws
... calling verify-prereqs
... calling kube-up
Starting cluster using os distro: vivid
Please specify AWS_IMAGE directly (region not recognized)
[root@ip-172-31-29-160 cluster]#

kubernetes/cluster/aws/config-default.sh

ZONE=${KUBE_AWS_ZONE:-ap-northeast-2a}
MASTER_SIZE=${MASTER_SIZE:-t2.large}
MINION_SIZE=${MINION_SIZE:-t2.large}
NUM_MINIONS=${NUM_MINIONS:-1}

ap-northeast-2a 是区域而不是区域,亚太地区(首尔)的区域 ID 是 ap-northeast-2。为了指定区域,需要设置AWS_S3_REGION变量:

export AWS_S3_REGION=ap-northeast-2

AWS 的 Kubernetes 指南:http://kubernetes.io/docs/getting-started-guides/aws/

Each region has multiple, isolated locations known as Availability Zones. Amazon EC2 provides you the ability to place resources, such as instances, and data in multiple locations. Resources aren't replicated across regions unless you do so specifically.

有关区域和可用性区域的更多详细信息:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html

终于自己发现了这个问题.....

在某些 AWS 区域创建 Kubernetes 时抛出错误“请直接指定 AWS_IMAGE(无法识别区域)”

因为部分区域无法被Kubernetes识别,所以我们需要手动导出镜像名称。

export AWS_IMAGE=ami-a39oi23