From 4c667c38c9deda82498cb4fbe17ce81468b52b3d Mon Sep 17 00:00:00 2001 From: Zach Loafman Date: Mon, 18 Jul 2016 14:20:45 -0700 Subject: [PATCH] GCE bring-up: Differentiate NODE_TAGS from NODE_INSTANCE_PREFIX Kubernetes-side fix to #29074 (GKE-side fix necessary as well) --- cluster/common.sh | 1 + cluster/gce/configure-vm.sh | 8 +++++++- cluster/gce/gci/configure-helper.sh | 7 ++++++- cluster/gce/trusty/configure-helper.sh | 7 ++++++- cluster/gce/util.sh | 1 + 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cluster/common.sh b/cluster/common.sh index 820ad69fed..0f5d8209f5 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -534,6 +534,7 @@ function build-kube-env { ENV_TIMESTAMP: $(yaml-quote $(date -u +%Y-%m-%dT%T%z)) INSTANCE_PREFIX: $(yaml-quote ${INSTANCE_PREFIX}) NODE_INSTANCE_PREFIX: $(yaml-quote ${NODE_INSTANCE_PREFIX}) +NODE_TAGS: $(yaml-quote ${NODE_TAGS:-}) CLUSTER_IP_RANGE: $(yaml-quote ${CLUSTER_IP_RANGE:-10.244.0.0/16}) SERVER_BINARY_TAR_URL: $(yaml-quote ${server_binary_tar_url}) SERVER_BINARY_TAR_HASH: $(yaml-quote ${SERVER_BINARY_TAR_HASH}) diff --git a/cluster/gce/configure-vm.sh b/cluster/gce/configure-vm.sh index 0c41162ce7..a9c516ff6d 100755 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -422,6 +422,7 @@ function create-salt-pillar() { mkdir -p /srv/salt-overlay/pillar cat </srv/salt-overlay/pillar/cluster-params.sls instance_prefix: '$(echo "$INSTANCE_PREFIX" | sed -e "s/'/''/g")' +node_tags: '$(echo "$NODE_TAGS" | sed -e "s/'/''/g")' node_instance_prefix: '$(echo "$NODE_INSTANCE_PREFIX" | sed -e "s/'/''/g")' cluster_cidr: '$(echo "$CLUSTER_IP_RANGE" | sed -e "s/'/''/g")' allocate_node_cidrs: '$(echo "$ALLOCATE_NODE_CIDRS" | sed -e "s/'/''/g")' @@ -814,8 +815,13 @@ EOF fi if [[ -n "${NODE_INSTANCE_PREFIX:-}" ]]; then + if [[ -n "${NODE_TAGS:-}" ]]; then + local -r node_tags="${NODE_TAGS}" + else + local -r node_tags="${NODE_INSTANCE_PREFIX}" + fi cat <>/etc/gce.conf -node-tags = ${NODE_INSTANCE_PREFIX} +node-tags = ${NODE_TAGS} node-instance-prefix = ${NODE_INSTANCE_PREFIX} EOF CLOUD_CONFIG=/etc/gce.conf diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 12226574fb..779cedfb37 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -189,8 +189,13 @@ EOF fi if [[ -n "${NODE_INSTANCE_PREFIX:-}" ]]; then use_cloud_config="true" + if [[ -n "${NODE_TAGS:-}" ]]; then + local -r node_tags="${NODE_TAGS}" + else + local -r node_tags="${NODE_INSTANCE_PREFIX}" + fi cat <>/etc/gce.conf -node-tags = ${NODE_INSTANCE_PREFIX} +node-tags = ${node_tags} node-instance-prefix = ${NODE_INSTANCE_PREFIX} EOF fi diff --git a/cluster/gce/trusty/configure-helper.sh b/cluster/gce/trusty/configure-helper.sh index b4251a844f..e995810cdc 100644 --- a/cluster/gce/trusty/configure-helper.sh +++ b/cluster/gce/trusty/configure-helper.sh @@ -332,8 +332,13 @@ EOF fi if [ -n "${NODE_INSTANCE_PREFIX:-}" ]; then use_cloud_config="true" + if [[ -n "${NODE_TAGS:-}" ]]; then + local -r node_tags="${NODE_TAGS}" + else + local -r node_tags="${NODE_INSTANCE_PREFIX}" + fi cat <>/etc/gce.conf -node-tags = ${NODE_INSTANCE_PREFIX} +node-tags = ${node_tags} node-instance-prefix = ${NODE_INSTANCE_PREFIX} EOF fi diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 9ae556cd07..230c69749e 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -83,6 +83,7 @@ if [[ "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then fi NODE_INSTANCE_PREFIX="${INSTANCE_PREFIX}-minion" +NODE_TAGS="${NODE_TAG}" ALLOCATE_NODE_CIDRS=true