From aacd79cc36347bd56d22169de23a5156761dacd6 Mon Sep 17 00:00:00 2001 From: Krzysztof Siedlecki Date: Thu, 28 Nov 2019 10:36:56 +0100 Subject: [PATCH] setting kubemark node labels --- test/kubemark/gce/util.sh | 4 ++++ test/kubemark/resources/hollow-node_template.yaml | 1 + test/kubemark/skeleton/util.sh | 5 +++++ test/kubemark/start-kubemark.sh | 2 ++ 4 files changed, 12 insertions(+) diff --git a/test/kubemark/gce/util.sh b/test/kubemark/gce/util.sh index af92950fe81..e55d09a5538 100644 --- a/test/kubemark/gce/util.sh +++ b/test/kubemark/gce/util.sh @@ -107,3 +107,7 @@ function delete-kubemark-master { "${KUBE_ROOT}/hack/e2e-internal/e2e-down.sh" ) } + +function calculate-node-labels { + echo "cloud.google.com/metadata-proxy-ready=true" +} diff --git a/test/kubemark/resources/hollow-node_template.yaml b/test/kubemark/resources/hollow-node_template.yaml index eec32a4c409..5c2b87c60ab 100644 --- a/test/kubemark/resources/hollow-node_template.yaml +++ b/test/kubemark/resources/hollow-node_template.yaml @@ -58,6 +58,7 @@ spec: "$(CONTENT_TYPE)", "--log-file=/var/log/kubelet-$(NODE_NAME).log", "--logtostderr=false", + "--node-labels={{hollow_node_labels}}", {{hollow_kubelet_params}} ] volumeMounts: diff --git a/test/kubemark/skeleton/util.sh b/test/kubemark/skeleton/util.sh index d64a2fe00d3..430743bb886 100644 --- a/test/kubemark/skeleton/util.sh +++ b/test/kubemark/skeleton/util.sh @@ -35,6 +35,11 @@ function delete-kubemark-master { echo "Deleting cluster..." } +# This function should return node labels. +function calculate-node-labels { + echo "" +} + # Common colors used throughout the kubemark scripts if [[ -z "${color_start-}" ]]; then declare -r color_start="\033[" diff --git a/test/kubemark/start-kubemark.sh b/test/kubemark/start-kubemark.sh index 33b4da49f1b..a6bf8191d89 100755 --- a/test/kubemark/start-kubemark.sh +++ b/test/kubemark/start-kubemark.sh @@ -152,6 +152,7 @@ function create-kube-hollow-node-resources { proxy_cpu=${KUBEMARK_HOLLOW_PROXY_MILLICPU:-$proxy_cpu} proxy_mem_per_node=${KUBEMARK_HOLLOW_PROXY_MEM_PER_NODE_KB:-50} proxy_mem=$((100 * 1024 + proxy_mem_per_node*NUM_NODES)) + hollow_node_labels=${HOLLOW_NODE_LABELS:-$(calculate-node-labels)} hollow_kubelet_params=$(eval "for param in ${HOLLOW_KUBELET_TEST_ARGS:-}; do echo -n \\\"\$param\\\",; done") hollow_kubelet_params=${hollow_kubelet_params%?} hollow_proxy_params=$(eval "for param in ${HOLLOW_PROXY_TEST_ARGS:-}; do echo -n \\\"\$param\\\",; done") @@ -166,6 +167,7 @@ function create-kube-hollow-node-resources { sed -i'' -e "s@{{kubemark_image_registry}}@${KUBEMARK_IMAGE_REGISTRY}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed -i'' -e "s@{{kubemark_image_tag}}@${KUBEMARK_IMAGE_TAG}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed -i'' -e "s@{{master_ip}}@${MASTER_IP}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" + sed -i'' -e "s@{{hollow_node_labels}}@${hollow_node_labels}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed -i'' -e "s@{{hollow_kubelet_params}}@${hollow_kubelet_params}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed -i'' -e "s@{{hollow_proxy_params}}@${hollow_proxy_params}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed -i'' -e "s@{{kubemark_mig_config}}@${KUBEMARK_MIG_CONFIG:-}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"