Merge pull request #1031 from DualSpark/script-cleanup

removing our image and forcing setting of an ami
This commit is contained in:
Justin Santa Barbara 2016-12-07 09:21:05 -05:00 committed by GitHub
commit b6c9525933
1 changed files with 15 additions and 5 deletions

View File

@ -23,29 +23,38 @@
# #
# This script (by design) will handle building a full kops cluster in AWS, # This script (by design) will handle building a full kops cluster in AWS,
# with a custom version of the Nodeup binary compiled at runtime. # with a custom version of the Nodeup binary compiled at runtime.
# #
# This script and Makefile uses aws client # This script and Makefile uses aws client
# https://aws.amazon.com/cli/ # https://aws.amazon.com/cli/
# and make sure you `aws configure` # and make sure you `aws configure`
# #
# Example usage # Example usage
# #
# KOPS_STATE_STORE="s3://my-dev-s3-state \ # KOPS_STATE_STORE="s3://my-dev-s3-state \
# CLUSTER_NAME="fullcluster.name.mydomain.io" \ # CLUSTER_NAME="fullcluster.name.mydomain.io" \
# NODEUP_BUCKET="s3-devel-bucket-name-store-nodeup" \ # NODEUP_BUCKET="s3-devel-bucket-name-store-nodeup" \
# IMAGE="kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21" \
# ./dev-build.sh # ./dev-build.sh
# #
############################################################################### ###############################################################################
KOPS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" KOPS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#
# Check that required binaries are installed
#
command -v make >/dev/null 2>&1 || { echo >&2 "I require make but it's not installed. Aborting."; exit 1; }
command -v go >/dev/null 2>&1 || { echo >&2 "I require go but it's not installed. Aborting."; exit 1; }
command -v docker >/dev/null 2>&1 || { echo >&2 "I require docker but it's not installed. Aborting."; exit 1; }
command -v aws >/dev/null 2>&1 || { echo >&2 "I require aws but it's not installed. Aborting."; exit 1; }
# #
# Check that expected vars are set # Check that expected vars are set
# #
[ -z "$KOPS_STATE_STORE" ] && echo "Need to set KOPS_STATE_STORE" && exit 1; [ -z "$KOPS_STATE_STORE" ] && echo "Need to set KOPS_STATE_STORE" && exit 1;
[ -z "$CLUSTER_NAME" ] && echo "Need to set CLUSTER_NAME" && exit 1; [ -z "$CLUSTER_NAME" ] && echo "Need to set CLUSTER_NAME" && exit 1;
[ -z "$NODEUP_BUCKET" ] && echo "Need to set NODEUP_BUCKET" && exit 1; [ -z "$NODEUP_BUCKET" ] && echo "Need to set NODEUP_BUCKET" && exit 1;
[ -z "$IMAGE" ] && echo "Need to set IMAGE or use the image listed here https://github.com/kubernetes/kops/blob/master/channels/stable" && exit 1;
# Cluster config # Cluster config
NODE_COUNT=${NODE_COUNT:-3} NODE_COUNT=${NODE_COUNT:-3}
@ -58,6 +67,7 @@ MASTER_SIZE=${MASTER_SIZE:-m4.large}
TOPOLOGY=${TOPOLOGY:-private} TOPOLOGY=${TOPOLOGY:-private}
NETWORKING=${NETWORKING:-weave} NETWORKING=${NETWORKING:-weave}
# How verbose go logging is
VERBOSITY=${VERBOSITY:-10} VERBOSITY=${VERBOSITY:-10}
cd $KOPS_DIRECTORY/.. cd $KOPS_DIRECTORY/..
@ -65,7 +75,7 @@ cd $KOPS_DIRECTORY/..
GIT_VER=git-$(git describe --always) GIT_VER=git-$(git describe --always)
[ -z "$GIT_VER" ] && echo "we do not have GIT_VER something is very wrong" && exit 1; [ -z "$GIT_VER" ] && echo "we do not have GIT_VER something is very wrong" && exit 1;
NODEUP_URL="https://s3-us-west-1.amazonaws.com/${NODEUP_BUCKET}/kops/${GIT_VER}/linux/amd64/nodeup" NODEUP_URL="https://${NODEUP_BUCKET}.amazonaws.com/kops/${GIT_VER}/linux/amd64/nodeup"
echo ========== echo ==========
echo "Starting build" echo "Starting build"
@ -96,7 +106,7 @@ NODEUP_URL=${NODEUP_URL} kops create cluster \
--topology $TOPOLOGY \ --topology $TOPOLOGY \
--networking $NETWORKING \ --networking $NETWORKING \
-v $VERBOSITY \ -v $VERBOSITY \
--image "k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-11-16" \ --image $IMAGE \
--yes --yes
echo ========== echo ==========