diff --git a/cluster/gce/coreos/helper.sh b/cluster/gce/coreos/helper.sh index 526d8e55f17..914fcdb95d1 100644 --- a/cluster/gce/coreos/helper.sh +++ b/cluster/gce/coreos/helper.sh @@ -121,12 +121,11 @@ function create-master-instance { --image "${MASTER_IMAGE}" \ --tags "${MASTER_TAG}" \ --network "${NETWORK}" \ - --scopes "storage-ro" "compute-rw" \ + --scopes "storage-ro,compute-rw" \ --can-ip-forward \ --metadata-from-file \ - "startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh" \ - "kube-env=${KUBE_TEMP}/master-kube-env.yaml" \ - --disk name="${MASTER_NAME}-pd" device-name=master-pd mode=rw boot=no auto-delete=no + "startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh,kube-env=${KUBE_TEMP}/master-kube-env.yaml" \ + --disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" } # TODO(dawnchen): Check $CONTAINER_RUNTIME to decide which diff --git a/cluster/gce/debian/helper.sh b/cluster/gce/debian/helper.sh index 6ae48475d0c..c338221cc33 100644 --- a/cluster/gce/debian/helper.sh +++ b/cluster/gce/debian/helper.sh @@ -99,12 +99,11 @@ function create-master-instance { --image "${MASTER_IMAGE}" \ --tags "${MASTER_TAG}" \ --network "${NETWORK}" \ - --scopes "storage-ro" "compute-rw" \ + --scopes "storage-ro,compute-rw" \ --can-ip-forward \ --metadata-from-file \ - "startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh" \ - "kube-env=${KUBE_TEMP}/master-kube-env.yaml" \ - --disk name="${MASTER_NAME}-pd" device-name=master-pd mode=rw boot=no auto-delete=no + "startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh,kube-env=${KUBE_TEMP}/master-kube-env.yaml" \ + --disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" } # TODO(mbforbes): Make $1 required. diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh index c8f9b1b72c5..e75ffd6c804 100755 --- a/cluster/gce/upgrade.sh +++ b/cluster/gce/upgrade.sh @@ -159,7 +159,7 @@ function upgrade-nodes() { # TODO(mbforbes): Refactor setting scope flags. local -a scope_flags=() if (( "${#MINION_SCOPES[@]}" > 0 )); then - scope_flags=("--scopes" "${MINION_SCOPES[@]}") + scope_flags=("--scopes" "$(join_csv ${MINION_SCOPES[@]})") else scope_flags=("--no-scopes") fi diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index cc9c243744a..6257e6d14db 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -36,6 +36,10 @@ ALLOCATE_NODE_CIDRS=true KUBE_PROMPT_FOR_UPDATE=y KUBE_SKIP_UPDATE=${KUBE_SKIP_UPDATE-"n"} +function join_csv { + local IFS=','; echo "$*"; +} + # Verify prereqs function verify-prereqs { local cmd @@ -363,7 +367,7 @@ function create-firewall-rule { --network "${NETWORK}" \ --source-ranges "$2" \ --target-tags "$3" \ - --allow tcp udp icmp esp ah sctp; then + --allow tcp,udp,icmp,esp,ah,sctp; then if (( attempt > 5 )); then echo -e "${color_red}Failed to create firewall rule $1 ${color_norm}" exit 2 @@ -459,7 +463,7 @@ function add-instance-metadata-from-file { if ! gcloud compute instances add-metadata "${instance}" \ --project "${PROJECT}" \ --zone "${ZONE}" \ - --metadata-from-file $(IFS=, ; echo "${kvs[*]}"); then + --metadata-from-file "$(join_csv ${kvs[@]})"; then if (( attempt > 5 )); then echo -e "${color_red}Failed to add instance metadata in ${instance} ${color_norm}" exit 2 @@ -575,7 +579,7 @@ function kube-up { --project "${PROJECT}" \ --network "${NETWORK}" \ --source-ranges "10.0.0.0/8" \ - --allow "tcp:1-65535" "udp:1-65535" "icmp" & + --allow "tcp:1-65535,udp:1-65535,icmp" & fi if ! gcloud compute firewall-rules describe --project "${PROJECT}" "${NETWORK}-default-ssh" &>/dev/null; then @@ -637,7 +641,7 @@ function kube-up { # TODO(mbforbes): Refactor setting scope flags. local -a scope_flags=() if (( "${#MINION_SCOPES[@]}" > 0 )); then - scope_flags=("--scopes" "${MINION_SCOPES[@]}") + scope_flags=("--scopes" "$(join_csv ${MINION_SCOPES[@]})") else scope_flags=("--no-scopes") fi diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index 91dd8cf806e..b79e949ee3c 100755 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -167,7 +167,7 @@ function test-setup() { # collisions here? "${GCLOUD}" compute firewall-rules create \ "${MINION_TAG}-${USER}-http-alt" \ - --allow tcp:80 tcp:8080 \ + --allow tcp:80,tcp:8080 \ --project "${PROJECT}" \ --target-tags "${MINION_TAG}" \ --network="${NETWORK}"