Skip to content

Commit

Permalink
Pipe content-type variable to hollow node
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed May 11, 2016
1 parent b79a1bb commit fe470b6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
28 changes: 26 additions & 2 deletions test/kubemark/resources/hollow-node_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,24 @@
{"containerPort": 10250},
{"containerPort": 10255}
],
"env": [
{
"name": "CONTENT_TYPE",
"valueFrom": {
"configMapKeyRef": {
"name": "node-configmap",
"key": "content.type"
}
}
}
],
"command": [
"./kubemark.sh"
],
"args": [
"--v=3",
"--morph=kubelet"
"--morph=kubelet",
"$(CONTENT_TYPE)"
],
"volumeMounts": [
{
Expand All @@ -60,12 +72,24 @@
{
"name": "hollow-proxy",
"image": "gcr.io/##project##/kubemark:latest",
"env": [
{
"name": "CONTENT_TYPE",
"valueFrom": {
"configMapKeyRef": {
"name": "node-configmap",
"key": "content.type"
}
}
}
],
"command": [
"./kubemark.sh"
],
"args": [
"--v=3",
"--morph=proxy"
"--morph=proxy",
"$(CONTENT_TYPE)"
],
"volumeMounts": [
{
Expand Down
16 changes: 16 additions & 0 deletions test/kubemark/start-kubemark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,20 @@ cat > "${KUBECONFIG_SECRET}" << EOF
}
EOF

NODE_CONFIGMAP="${RESOURCE_DIRECTORY}/node_config_map.json"
cat > "${NODE_CONFIGMAP}" << EOF
{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": {
"name": "node-configmap"
},
"data": {
"content.type": "${TEST_CLUSTER_API_CONTENT_TYPE}"
}
}
EOF

LOCAL_KUBECONFIG="${RESOURCE_DIRECTORY}/kubeconfig.loc"
cat > "${LOCAL_KUBECONFIG}" << EOF
apiVersion: v1
Expand Down Expand Up @@ -247,10 +261,12 @@ sed -i'' -e "s/##EVENTER_MEM##/${eventer_mem}/g" "${RESOURCE_DIRECTORY}/addons/h

"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/kubemark-ns.json"
"${KUBECTL}" create -f "${KUBECONFIG_SECRET}" --namespace="kubemark"
"${KUBECTL}" create -f "${NODE_CONFIGMAP}" --namespace="kubemark"
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/addons" --namespace="kubemark"
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/hollow-node.json" --namespace="kubemark"

rm "${KUBECONFIG_SECRET}"
rm "${NODE_CONFIGMAP}"

echo "Waiting for all HollowNodes to become Running..."
start=$(date +%s)
Expand Down

0 comments on commit fe470b6

Please sign in to comment.