我跟随this guide在AWS上的Ubuntu 14.04映像上设置Kubernetes。
sudo apt-get update
sudo apt-get install curl
sudo apt-get install awscli
aws configure # enter credentials, etc.
# fix `locale` errors
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export KUBE_AWS_ZONE=us-east-1b
export NUM_NODES=2
export MASTER_SIZE=t2.micro
export NODE_SIZE=t2.micro
export AWS_S3_BUCKET=my.s3.bucket.kube
export AWS_S3_REGION=us-east-1b
export INSTANCE_PREFIX=k8s
export KUBERNETES_PROVIDER=aws
curl -sS https://get.k8s.io | bash
然而这失败了......
ubuntu@ip-172-31-24-216:~$ curl -sS https://get.k8s.io | bash
Downloading kubernetes release v1.2.4 to /home/ubuntu/kubernetes.tar.gz
--2016-05-21 17:01:20-- https://storage.googleapis.com/kubernetes-release/release/v1.2.4/kubernetes.tar.gz
Resolving storage.googleapis.com (storage.googleapis.com)... 74.125.29.128, 2607:f8b0:400d:c03::80
Connecting to storage.googleapis.com (storage.googleapis.com)|74.125.29.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 496696744 (474M) [application/x-tar]
Saving to: ‘kubernetes.tar.gz’
100%[======================================>] 496,696,744 57.4MB/s in 8.2s
2016-05-21 17:01:29 (58.1 MB/s) - ‘kubernetes.tar.gz’ saved [496696744/496696744]
Unpacking kubernetes release v1.2.4
Creating a kubernetes on aws...
... Starting cluster in us-east-1b using provider aws
... calling verify-prereqs
... calling kube-up
Starting cluster using os distro: jessie
Uploading to Amazon S3
+++ Staging server tars to S3 Storage: my.s3.bucket.kube/devel
usage: aws [options] <command> <subcommand> [parameters]
aws: error: argument --region: expected one argument
我尝试修改cluster/aws/util.sh
以打印s3_bucket_location
(根据this question的建议,我得到一个空字符串。我猜测它失败的原因?
The docs说US East的空字符串是正常的,但我尝试更改区域(其他一切保持不变),我仍然得到一个空字符串。
确实创建了s3存储桶。
任何帮助都将不胜感激。
答案 0 :(得分:1)
让我觉得你的区域和区域很混乱。
使用ec2-describe-regions命令描述您的区域。
PROMPT> ec2-describe-regions
REGION us-east-1 ec2.us-east-1.amazonaws.com
REGION ap-northeast-1 ec2.ap-northeast-1.amazonaws.com
REGION ap-southeast-1 ec2.ap-southeast-1.amazonaws.com
..
Use the ec2-describe-availability-zones command as follows to describe your Availability Zones within the us-east-1 region.
PROMPT> ec2-describe-availability-zones --region us-east-1
AVAILABILITYZONE us-east-1a available us-east-1
AVAILABILITYZONE us-east-1b available us-east-1
AVAILABILITYZONE us-east-1c available us-east-1
AVAILABILITYZONE us-east-1d available us-east-1
确保在导出AWS_S3_REGION =
中使用区域