From 6597daddd60f0d29f487cf33fda3fe97b230cfb3 Mon Sep 17 00:00:00 2001 From: Andy Zheng Date: Tue, 15 Mar 2016 13:24:13 -0700 Subject: [PATCH] Trusty: Fix heapster breakage caused by #22940 --- cluster/gce/trusty/configure.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cluster/gce/trusty/configure.sh b/cluster/gce/trusty/configure.sh index 4b51fddbb3c..ecb0ec2880a 100644 --- a/cluster/gce/trusty/configure.sh +++ b/cluster/gce/trusty/configure.sh @@ -711,9 +711,12 @@ prepare_kube_addons() { file_dir="cluster-monitoring/${ENABLE_CLUSTER_MONITORING}" setup_addon_manifests "addons" "${file_dir}" # Replace the salt configurations with variable values. - heapster_memory="200Mi" - if [ -n "${NUM_NODES:-}" ] && [ "${NUM_NODES}" -gt 1 ]; then - heapster_memory="$((${NUM_NODES} * 3 + 200))Mi" + metrics_memory="200Mi" + eventer_memory="200Mi" + if [ -n "${NUM_NODES:-}" ] && [ "${NUM_NODES}" -ge 1 ]; then + num_kube_nodes="$((${NUM_NODES}-1))" + metrics_memory="$((${num_kube_nodes} * 4 + 200))Mi" + eventer_memory="$((${num_kube_nodes} * 500 + 200 * 1024))Ki" fi controller_yaml="${addon_dst_dir}/${file_dir}" if [ "${ENABLE_CLUSTER_MONITORING:-}" = "googleinfluxdb" ]; then @@ -722,7 +725,8 @@ prepare_kube_addons() { controller_yaml="${controller_yaml}/heapster-controller.yaml" fi remove_salt_config_comments "${controller_yaml}" - sed -i -e "s@{{ *heapster_memory *}}@${heapster_memory}@g" "${controller_yaml}" + sed -i -e "s@{{ *metrics_memory *}}@${metrics_memory}@g" "${controller_yaml}" + sed -i -e "s@{{ *eventer_memory *}}@${eventer_memory}@g" "${controller_yaml}" fi cp "${addon_src_dir}/namespace.yaml" "${addon_dst_dir}" if [ "${ENABLE_L7_LOADBALANCING:-}" = "glbc" ]; then