diff --git a/cluster/addons/cluster-monitoring/google/heapster-controller.yaml b/cluster/addons/cluster-monitoring/google/heapster-controller.yaml index c4e0a38bc06..d2864c14b0b 100644 --- a/cluster/addons/cluster-monitoring/google/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/google/heapster-controller.yaml @@ -79,7 +79,7 @@ spec: - /eventer - --source=kubernetes:'' - --sink=gcl - - image: k8s.gcr.io/addon-resizer:1.8.2 + - image: k8s.gcr.io/addon-resizer:1.8.3 name: heapster-nanny resources: limits: @@ -112,6 +112,9 @@ spec: - --container=heapster - --poll-period=300000 - --estimator=exponential + # Specifies the smallest cluster (defined in number of nodes) + # resources will be scaled to. + - --minClusterSize={{ heapster_min_cluster_size }} - image: k8s.gcr.io/addon-resizer:1.8.2 name: eventer-nanny resources: diff --git a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml index c192ca8fbbf..fb5446626aa 100644 --- a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml +++ b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml @@ -80,7 +80,7 @@ spec: - /eventer - --source=kubernetes:'' - --sink=gcl - - image: k8s.gcr.io/addon-resizer:1.8.2 + - image: k8s.gcr.io/addon-resizer:1.8.3 name: heapster-nanny resources: limits: @@ -113,6 +113,9 @@ spec: - --container=heapster - --poll-period=300000 - --estimator=exponential + # Specifies the smallest cluster (defined in number of nodes) + # resources will be scaled to. + - --minClusterSize={{ heapster_min_cluster_size }} - image: k8s.gcr.io/addon-resizer:1.8.2 name: eventer-nanny resources: diff --git a/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml b/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml index ebba295af2f..8c22aaece75 100644 --- a/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml @@ -79,7 +79,7 @@ spec: - /eventer - --source=kubernetes:'' - --sink=influxdb:http://monitoring-influxdb:8086 - - image: k8s.gcr.io/addon-resizer:1.8.2 + - image: k8s.gcr.io/addon-resizer:1.8.3 name: heapster-nanny resources: limits: @@ -112,6 +112,9 @@ spec: - --container=heapster - --poll-period=300000 - --estimator=exponential + # Specifies the smallest cluster (defined in number of nodes) + # resources will be scaled to. + - --minClusterSize={{ heapster_min_cluster_size }} - image: k8s.gcr.io/addon-resizer:1.8.2 name: eventer-nanny resources: diff --git a/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml b/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml index 97feefb587d..0cd6d6fa24f 100644 --- a/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml @@ -81,7 +81,7 @@ spec: fieldRef: fieldPath: metadata.namespace # END_PROMETHEUS_TO_SD - - image: k8s.gcr.io/addon-resizer:1.8.2 + - image: k8s.gcr.io/addon-resizer:1.8.3 name: heapster-nanny resources: limits: @@ -114,6 +114,9 @@ spec: - --container=heapster - --poll-period=300000 - --estimator=exponential + # Specifies the smallest cluster (defined in number of nodes) + # resources will be scaled to. + - --minClusterSize={{ heapster_min_cluster_size }} volumes: - name: heapster-config-volume configMap: diff --git a/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml b/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml index f8b6bdb0e17..a6ee6a8ca61 100644 --- a/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml @@ -59,7 +59,7 @@ spec: command: - /heapster - --source=kubernetes.summary_api:'' - - image: k8s.gcr.io/addon-resizer:1.8.2 + - image: k8s.gcr.io/addon-resizer:1.8.3 name: heapster-nanny resources: limits: @@ -92,6 +92,9 @@ spec: - --container=heapster - --poll-period=300000 - --estimator=exponential + # Specifies the smallest cluster (defined in number of nodes) + # resources will be scaled to. + - --minClusterSize={{ heapster_min_cluster_size }} volumes: - name: heapster-config-volume configMap: diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 9248f8dafa5..093fa832edd 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -2350,10 +2350,17 @@ EOF base_eventer_memory="190Mi" base_metrics_cpu="${HEAPSTER_GCP_BASE_CPU:-80m}" nanny_memory="90Mi" - local -r metrics_memory_per_node="${HEAPSTER_GCP_MEMORY_PER_NODE:-4}" + local heapster_min_cluster_size="16" + local metrics_memory_per_node="${HEAPSTER_GCP_MEMORY_PER_NODE:-4}" local -r metrics_cpu_per_node="${HEAPSTER_GCP_CPU_PER_NODE:-0.5}" local -r eventer_memory_per_node="500" local -r nanny_memory_per_node="200" + if [[ "${ENABLE_SYSTEM_ADDON_RESOURCE_OPTIMIZATIONS:-}" == "true" ]]; then + base_metrics_memory="${HEAPSTER_GCP_BASE_MEMORY:-100Mi}" + base_metrics_cpu="${HEAPSTER_GCP_BASE_CPU:-10m}" + metrics_memory_per_node="${HEAPSTER_GCP_MEMORY_PER_NODE:-4}" + heapster_min_cluster_size="5" + fi if [[ -n "${NUM_NODES:-}" && "${NUM_NODES}" -ge 1 ]]; then num_kube_nodes="$((${NUM_NODES}+1))" nanny_memory="$((${num_kube_nodes} * ${nanny_memory_per_node} + 90 * 1024))Ki" @@ -2374,6 +2381,7 @@ EOF sed -i -e "s@{{ *eventer_memory_per_node *}}@${eventer_memory_per_node}@g" "${controller_yaml}" sed -i -e "s@{{ *nanny_memory *}}@${nanny_memory}@g" "${controller_yaml}" sed -i -e "s@{{ *metrics_cpu_per_node *}}@${metrics_cpu_per_node}@g" "${controller_yaml}" + sed -i -e "s@{{ *heapster_min_cluster_size *}}@${heapster_min_cluster_size}@g" "${controller_yaml}" update-prometheus-to-sd-parameters ${controller_yaml} if [[ "${ENABLE_CLUSTER_MONITORING:-}" == "stackdriver" ]]; then