Merge pull request #6011 from justinsb/aws_specify_zone

Fix AWS region vs zone
This commit is contained in:
Zach Loafman
2015-03-31 12:26:05 -07:00
7 changed files with 193 additions and 86 deletions

View File

@@ -14,8 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: the zone isn't quite piped into all the right places...
ZONE=${KUBE_AWS_ZONE:-us-west-2}
ZONE=${KUBE_AWS_ZONE:-us-west-2a}
MASTER_SIZE=${MASTER_SIZE:-t2.micro}
MINION_SIZE=${MINION_SIZE:-t2.micro}
NUM_MINIONS=${NUM_MINIONS:-4}

View File

@@ -14,8 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: this isn't quite piped into all the right places...
ZONE=${KUBE_AWS_ZONE:-us-west-2}
ZONE=${KUBE_AWS_ZONE:-us-west-2a}
MASTER_SIZE=${MASTER_SIZE:-t2.micro}
MINION_SIZE=${MINION_SIZE:-t2.micro}
NUM_MINIONS=${NUM_MINIONS:-2}

View File

@@ -5,6 +5,10 @@ specific to AWS are documented in this file, for cross-provider options see TODO
This is a work-in-progress; not all options are documented yet!
## ZONE
The AWS availability zone to deploy to. Defaults to us-west-2a.
## AWS_IMAGE
The AMI to use. If not specified, the image will be selected based on the AWS region.

View File

@@ -28,7 +28,7 @@ EOF
cat <<EOF > /etc/aws.conf
[Global]
Region = ${AWS_ZONE}
Zone = ${ZONE}
EOF
# Auto accept all keys from minions that try to join

View File

@@ -21,7 +21,10 @@
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/cluster/aws/${KUBE_CONFIG_FILE-"config-default.sh"}"
export AWS_DEFAULT_REGION=${ZONE}
# This removes the final character in bash (somehow)
AWS_REGION=${ZONE%?}
export AWS_DEFAULT_REGION=${AWS_REGION}
AWS_CMD="aws --output json ec2"
AWS_ELB_CMD="aws --output json elb"
@@ -105,7 +108,7 @@ function detect-image () {
# See here: http://cloud-images.ubuntu.com/locator/ec2/ for other images
# This will need to be updated from time to time as amis are deprecated
if [[ -z "${AWS_IMAGE-}" ]]; then
case "${ZONE}" in
case "${AWS_REGION}" in
ap-northeast-1)
AWS_IMAGE=ami-93876e93
;;
@@ -429,7 +432,7 @@ function kube-up {
echo "readonly NODE_INSTANCE_PREFIX='${INSTANCE_PREFIX}-minion'"
echo "readonly SERVER_BINARY_TAR_URL='${SERVER_BINARY_TAR_URL}'"
echo "readonly SALT_TAR_URL='${SALT_TAR_URL}'"
echo "readonly AWS_ZONE='${ZONE}'"
echo "readonly ZONE='${ZONE}'"
echo "readonly MASTER_HTPASSWD='${htpasswd}'"
echo "readonly PORTAL_NET='${PORTAL_NET}'"
echo "readonly ENABLE_CLUSTER_MONITORING='${ENABLE_CLUSTER_MONITORING:-false}'"