"aws: error: argument --region: expected one argument" when running Kubernetes on AWS

0 votes

I'm trying to set up kubernetes on aws ubuntu instance.

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

curl -sS https://get.k8s.io | bash

This fails, however...

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)..., 2607:f8b0:400d:c03::80
Connecting to storage.googleapis.com (storage.googleapis.com)||: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

Any help will be appreciated, thank you :)

Oct 4, 2018 in Kubernetes by lina
• 8,220 points

2 answers to this question.

0 votes

One problem might be AWS_S3_REGION=us-east-1bus-east-1b is an availability zone, not a region. You should just use us-east-1

answered Oct 4, 2018 by Kalgi
• 51,950 points
0 votes
You seem pretty confused with AZ and regions 
Use the ec2-describe-regions command as follows to describe your 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
answered Oct 4, 2018 by Priyaj
• 57,640 points

Related Questions In Kubernetes

0 votes
1 answer
0 votes
1 answer

oci runtime error while running kubernetes on rancher cluster

You need to switch Docker to 1.12.x; ...READ MORE

answered Sep 6, 2018 in Kubernetes by Kalgi
• 51,950 points
0 votes
1 answer
0 votes
1 answer

Installing Kubernetes on aws gives an error

seems like you are missing region. Try ...READ MORE

answered Oct 4, 2018 in Kubernetes by Kalgi
• 51,950 points
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 51,950 points
+1 vote
1 answer
0 votes
1 answer
0 votes
2 answers

NoSuchBucket error when running Kubernetes on AWS

It was a bug on their part. ...READ MORE

answered Sep 4, 2018 in Kubernetes by Nilesh
• 6,980 points