Skip to content

Commit

Permalink
Add envs for configuring hollow-node resource usage.
Browse files Browse the repository at this point in the history
In addition clean up template variables to always use lower case in
hollow-node_template.yaml.
  • Loading branch information
mm4tt committed Nov 8, 2019
1 parent 557275f commit 97e5dd4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
12 changes: 6 additions & 6 deletions test/kubemark/resources/hollow-node_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ spec:
mountPath: /var/log
resources:
requests:
cpu: 40m
memory: 100M
cpu: {{hollow_kubelet_millicpu}}m
memory: {{hollow_kubelet_mem_Ki}}Ki
securityContext:
privileged: true
- name: hollow-proxy
Expand All @@ -90,8 +90,8 @@ spec:
mountPath: /var/log
resources:
requests:
cpu: {{HOLLOW_PROXY_CPU}}m
memory: {{HOLLOW_PROXY_MEM}}Ki
cpu: {{hollow_proxy_millicpu}}m
memory: {{hollow_proxy_mem_Ki}}Ki
- name: hollow-node-problem-detector
image: k8s.gcr.io/node-problem-detector:v0.8.0
env:
Expand All @@ -117,8 +117,8 @@ spec:
mountPath: /var/log
resources:
requests:
cpu: 20m
memory: 20Mi
cpu: {{npd_millicpu}}m
memory: {{npd_mem_Ki}}Ki
securityContext:
privileged: true
# Keep the pod running on unreachable node for 15 minutes.
Expand Down
12 changes: 9 additions & 3 deletions test/kubemark/start-kubemark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,16 @@ function create-kube-hollow-node-resources {
if [ "${NUM_NODES}" -gt 1000 ]; then
proxy_cpu=50
fi
proxy_mem_per_node=50
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))
sed -i'' -e "s@{{HOLLOW_PROXY_CPU}}@${proxy_cpu}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
sed -i'' -e "s@{{HOLLOW_PROXY_MEM}}@${proxy_mem}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"

sed -i'' -e "s@{{hollow_kubelet_millicpu}}@${KUBEMARK_HOLLOW_KUBELET_MILLICPU:-40}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
sed -i'' -e "s@{{hollow_kubelet_mem_Ki}}@${KUBEMARK_HOLLOW_KUBELET_MEM_KB:-$((100*1024))}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
sed -i'' -e "s@{{hollow_proxy_millicpu}}@${proxy_cpu}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
sed -i'' -e "s@{{hollow_proxy_mem_Ki}}@${proxy_mem}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
sed -i'' -e "s@{{npd_millicpu}}@${KUBEMARK_NPD_MILLICPU:-20}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
sed -i'' -e "s@{{npd_mem_Ki}}@${KUBEMARK_NPD_MEM_KB:-$((20*1024))}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
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"
Expand Down

0 comments on commit 97e5dd4

Please sign in to comment.