diff --git a/cluster/addons/cluster-monitoring/google/heapster-controller.yaml b/cluster/addons/cluster-monitoring/google/heapster-controller.yaml index 1d0de829987..7ae4d4ef693 100644 --- a/cluster/addons/cluster-monitoring/google/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/google/heapster-controller.yaml @@ -1,3 +1,8 @@ +{% set heapster_memory = "300Mi" -%} +{% if pillar['num_nodes'] is defined -%} + {% set heapster_memory = (200 + pillar['num_nodes'] * 12)|string + "Mi" -%} +{% endif -%} + apiVersion: v1 kind: ReplicationController metadata: @@ -25,7 +30,7 @@ spec: resources: limits: cpu: 100m - memory: 300Mi + memory: {{ heapster_memory }} command: - /heapster - --source=kubernetes:'' diff --git a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml index ed6971ee969..b5aa21f6327 100644 --- a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml +++ b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml @@ -1,3 +1,8 @@ +{% set heapster_memory = "300Mi" -%} +{% if pillar['num_nodes'] is defined -%} + {% set heapster_memory = (200 + pillar['num_nodes'] * 12)|string + "Mi" -%} +{% endif -%} + apiVersion: v1 kind: ReplicationController metadata: @@ -25,7 +30,7 @@ spec: resources: limits: cpu: 100m - memory: 300Mi + memory: {{ heapster_memory }} command: - /heapster - --source=kubernetes:'' diff --git a/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml b/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml index e6b71a10177..0ac486bcd9b 100644 --- a/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml @@ -1,3 +1,8 @@ +{% set heapster_memory = "300Mi" -%} +{% if pillar['num_nodes'] is defined -%} + {% set heapster_memory = (200 + pillar['num_nodes'] * 12)|string + "Mi" -%} +{% endif -%} + apiVersion: v1 kind: ReplicationController metadata: @@ -25,7 +30,7 @@ spec: resources: limits: cpu: 100m - memory: 300Mi + memory: {{ heapster_memory }} command: - /heapster - --source=kubernetes:'' diff --git a/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml b/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml index ed53a9d9df5..a1c77b6408e 100644 --- a/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml +++ b/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml @@ -1,3 +1,8 @@ +{% set heapster_memory = "300Mi" -%} +{% if pillar['num_nodes'] is defined -%} + {% set heapster_memory = (200 + pillar['num_nodes'] * 12)|string + "Mi" -%} +{% endif -%} + apiVersion: v1 kind: ReplicationController metadata: @@ -25,7 +30,7 @@ spec: resources: limits: cpu: 100m - memory: 300Mi + memory: {{ heapster_memory }} command: - /heapster - --source=kubernetes:'' diff --git a/cluster/aws/templates/create-dynamic-salt-files.sh b/cluster/aws/templates/create-dynamic-salt-files.sh index 63660742156..c74a2c48fcc 100644 --- a/cluster/aws/templates/create-dynamic-salt-files.sh +++ b/cluster/aws/templates/create-dynamic-salt-files.sh @@ -40,6 +40,7 @@ network_provider: '$(echo "$NETWORK_PROVIDER")' opencontrail_tag: '$(echo "$OPENCONTRAIL_TAG")' opencontrail_kubernetes_tag: '$(echo "$OPENCONTRAIL_KUBERNETES_TAG")' opencontrail_public_subnet: '$(echo "$OPENCONTRAIL_PUBLIC_SUBNET")' +num_nodes: $(echo "${NUM_MINIONS}") EOF if [ -n "${ENABLE_EXPERIMENTAL_API:-}" ]; then diff --git a/cluster/gce/configure-vm.sh b/cluster/gce/configure-vm.sh index 37488654dab..e1055c8b181 100755 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -284,6 +284,7 @@ opencontrail_public_subnet: '$(echo "$OPENCONTRAIL_PUBLIC_SUBNET")' enable_manifest_url: '$(echo "$ENABLE_MANIFEST_URL" | sed -e "s/'/''/g")' manifest_url: '$(echo "$MANIFEST_URL" | sed -e "s/'/''/g")' manifest_url_header: '$(echo "$MANIFEST_URL_HEADER" | sed -e "s/'/''/g")' +num_nodes: $(echo "${NUM_MINIONS}") EOF if [ -n "${APISERVER_TEST_ARGS:-}" ]; then diff --git a/cluster/gce/coreos/helper.sh b/cluster/gce/coreos/helper.sh index 41626739910..c7d09a7d24e 100755 --- a/cluster/gce/coreos/helper.sh +++ b/cluster/gce/coreos/helper.sh @@ -69,6 +69,7 @@ KUBELET_KEY: $(yaml-quote ${KUBELET_KEY_BASE64:-}) KUBECFG_CERT: $(yaml-quote ${KUBECFG_CERT_BASE64:-}) KUBECFG_KEY: $(yaml-quote ${KUBECFG_KEY_BASE64:-}) KUBELET_APISERVER: $(yaml-quote ${KUBELET_APISERVER:-}) +NUM_MINIONS: $(yaml-quote ${NUM_MINIONS}) EOF else cat >>$file <>$file <