python -c"import json,sys; lst = [str(subnet['SubnetId']) for subnet in json.load(sys.stdin)['Subnets'] if subnet['VpcId'] == '$1' and subnet['AvailabilityZone'] == '$2']; print ''.join(lst)"
python -c"import json,sys; lst = [str(igw['InternetGatewayId']) for igw in json.load(sys.stdin)['InternetGateways'] for attachment in igw['Attachments'] if attachment['VpcId'] == '$1']; print ''.join(lst)"
local vpc_id=$1
}
$AWS_CMD--output text describe-internet-gateways \
--filtersName=attachment.vpc-id,Values=${vpc_id}\
function get_route_table_id {
--query InternetGateways[].InternetGatewayId
python -c"import json,sys; lst = [str(route_table['RouteTableId']) for route_table in json.load(sys.stdin)['RouteTables'] if route_table['VpcId'] == '$1']; print ''.join(lst)"
}
}
function get_elbs_in_vpc {
function get_elbs_in_vpc {
...
@@ -163,6 +189,7 @@ function query-running-minions () {
...
@@ -163,6 +189,7 @@ function query-running-minions () {
# TODO(justinsb): This is really not necessary any more
# TODO(justinsb): This is really not necessary any more
# Wait 3 minutes for cluster to come up. We hit it with a "highstate" after that to
# Wait 3 minutes for cluster to come up. We hit it with a "highstate" after that to
...
@@ -1038,7 +1100,11 @@ function kube-up {
...
@@ -1038,7 +1100,11 @@ function kube-up {
done
done
echo"Kubernetes cluster created."
echo"Kubernetes cluster created."
}
# Creates the ~/.kube/config file, getting the information from the master
# The master much be running and set in KUBE_MASTER_IP
function build-config(){
# TODO use token instead of kube_auth
# TODO use token instead of kube_auth
export KUBE_CERT="/tmp/$RANDOM-kubecfg.crt"
export KUBE_CERT="/tmp/$RANDOM-kubecfg.crt"
export KUBE_KEY="/tmp/$RANDOM-kubecfg.key"
export KUBE_KEY="/tmp/$RANDOM-kubecfg.key"
...
@@ -1057,11 +1123,16 @@ function kube-up {
...
@@ -1057,11 +1123,16 @@ function kube-up {
create-kubeconfig
create-kubeconfig
)
)
}
# Sanity check the cluster and print confirmation messages
function check-cluster(){
echo"Sanity checking cluster..."
echo"Sanity checking cluster..."
sleep 5
sleep 5
detect-minions >$LOG
# Don't bail on errors, we want to be able to print some info.
# Don't bail on errors, we want to be able to print some info.
set +e
set +e
...
@@ -1127,20 +1198,26 @@ function kube-down {
...
@@ -1127,20 +1198,26 @@ function kube-down {
done
done
fi
fi
if[[-n$(${AWS_ASG_CMD}--output text describe-auto-scaling-groups --auto-scaling-group-names${ASG_NAME}--query AutoScalingGroups[].AutoScalingGroupName)]];then
if[[-n$(${AWS_ASG_CMD}--output text describe-launch-configurations --launch-configuration-names${ASG_NAME}--query LaunchConfigurations[].LaunchConfigurationName)]];then
if[[-n$(${AWS_ASG_CMD}--output text describe-auto-scaling-groups --auto-scaling-group-names${asg_group}--query AutoScalingGroups[].AutoScalingGroupName)]];then
if[[-n$(${AWS_ASG_CMD}--output text describe-launch-configurations --launch-configuration-names${asg_group}--query LaunchConfigurations[].LaunchConfigurationName)]];then