Skip to content

Commit aacd79c

Browse files
committed
setting kubemark node labels
1 parent 7ed5eb6 commit aacd79c

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

test/kubemark/gce/util.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,7 @@ function delete-kubemark-master {
107107
"${KUBE_ROOT}/hack/e2e-internal/e2e-down.sh"
108108
)
109109
}
110+
111+
function calculate-node-labels {
112+
echo "cloud.google.com/metadata-proxy-ready=true"
113+
}

test/kubemark/resources/hollow-node_template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ spec:
5858
"$(CONTENT_TYPE)",
5959
"--log-file=/var/log/kubelet-$(NODE_NAME).log",
6060
"--logtostderr=false",
61+
"--node-labels={{hollow_node_labels}}",
6162
{{hollow_kubelet_params}}
6263
]
6364
volumeMounts:

test/kubemark/skeleton/util.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ function delete-kubemark-master {
3535
echo "Deleting cluster..."
3636
}
3737

38+
# This function should return node labels.
39+
function calculate-node-labels {
40+
echo ""
41+
}
42+
3843
# Common colors used throughout the kubemark scripts
3944
if [[ -z "${color_start-}" ]]; then
4045
declare -r color_start="\033["

test/kubemark/start-kubemark.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ function create-kube-hollow-node-resources {
152152
proxy_cpu=${KUBEMARK_HOLLOW_PROXY_MILLICPU:-$proxy_cpu}
153153
proxy_mem_per_node=${KUBEMARK_HOLLOW_PROXY_MEM_PER_NODE_KB:-50}
154154
proxy_mem=$((100 * 1024 + proxy_mem_per_node*NUM_NODES))
155+
hollow_node_labels=${HOLLOW_NODE_LABELS:-$(calculate-node-labels)}
155156
hollow_kubelet_params=$(eval "for param in ${HOLLOW_KUBELET_TEST_ARGS:-}; do echo -n \\\"\$param\\\",; done")
156157
hollow_kubelet_params=${hollow_kubelet_params%?}
157158
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 {
166167
sed -i'' -e "s@{{kubemark_image_registry}}@${KUBEMARK_IMAGE_REGISTRY}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
167168
sed -i'' -e "s@{{kubemark_image_tag}}@${KUBEMARK_IMAGE_TAG}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
168169
sed -i'' -e "s@{{master_ip}}@${MASTER_IP}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
170+
sed -i'' -e "s@{{hollow_node_labels}}@${hollow_node_labels}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
169171
sed -i'' -e "s@{{hollow_kubelet_params}}@${hollow_kubelet_params}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
170172
sed -i'' -e "s@{{hollow_proxy_params}}@${hollow_proxy_params}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
171173
sed -i'' -e "s@{{kubemark_mig_config}}@${KUBEMARK_MIG_CONFIG:-}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"

0 commit comments

Comments
 (0)