Make heapster config creation dynamic
This commit is contained in:
		| @@ -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 | apiVersion: v1 | ||||||
| kind: ReplicationController | kind: ReplicationController | ||||||
| metadata: | metadata: | ||||||
| @@ -25,7 +30,7 @@ spec: | |||||||
|           resources: |           resources: | ||||||
|             limits: |             limits: | ||||||
|               cpu: 100m |               cpu: 100m | ||||||
|               memory: 300Mi |               memory: {{ heapster_memory }} | ||||||
|           command: |           command: | ||||||
|             - /heapster |             - /heapster | ||||||
|             - --source=kubernetes:'' |             - --source=kubernetes:'' | ||||||
|   | |||||||
| @@ -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 | apiVersion: v1 | ||||||
| kind: ReplicationController | kind: ReplicationController | ||||||
| metadata: | metadata: | ||||||
| @@ -25,7 +30,7 @@ spec: | |||||||
|           resources: |           resources: | ||||||
|             limits: |             limits: | ||||||
|               cpu: 100m |               cpu: 100m | ||||||
|               memory: 300Mi |               memory: {{ heapster_memory }} | ||||||
|           command: |           command: | ||||||
|             - /heapster |             - /heapster | ||||||
|             - --source=kubernetes:'' |             - --source=kubernetes:'' | ||||||
|   | |||||||
| @@ -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 | apiVersion: v1 | ||||||
| kind: ReplicationController | kind: ReplicationController | ||||||
| metadata: | metadata: | ||||||
| @@ -25,7 +30,7 @@ spec: | |||||||
|           resources: |           resources: | ||||||
|             limits: |             limits: | ||||||
|               cpu: 100m |               cpu: 100m | ||||||
|               memory: 300Mi |               memory: {{ heapster_memory }} | ||||||
|           command: |           command: | ||||||
|             - /heapster |             - /heapster | ||||||
|             - --source=kubernetes:'' |             - --source=kubernetes:'' | ||||||
|   | |||||||
| @@ -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 | apiVersion: v1 | ||||||
| kind: ReplicationController | kind: ReplicationController | ||||||
| metadata: | metadata: | ||||||
| @@ -25,7 +30,7 @@ spec: | |||||||
|           resources: |           resources: | ||||||
|             limits: |             limits: | ||||||
|               cpu: 100m |               cpu: 100m | ||||||
|               memory: 300Mi |               memory: {{ heapster_memory }} | ||||||
|           command: |           command: | ||||||
|             - /heapster |             - /heapster | ||||||
|             - --source=kubernetes:'' |             - --source=kubernetes:'' | ||||||
|   | |||||||
| @@ -40,6 +40,7 @@ network_provider: '$(echo "$NETWORK_PROVIDER")' | |||||||
| opencontrail_tag: '$(echo "$OPENCONTRAIL_TAG")' | opencontrail_tag: '$(echo "$OPENCONTRAIL_TAG")' | ||||||
| opencontrail_kubernetes_tag: '$(echo "$OPENCONTRAIL_KUBERNETES_TAG")' | opencontrail_kubernetes_tag: '$(echo "$OPENCONTRAIL_KUBERNETES_TAG")' | ||||||
| opencontrail_public_subnet: '$(echo "$OPENCONTRAIL_PUBLIC_SUBNET")' | opencontrail_public_subnet: '$(echo "$OPENCONTRAIL_PUBLIC_SUBNET")' | ||||||
|  | num_nodes: $(echo "${NUM_MINIONS}") | ||||||
| EOF | EOF | ||||||
|  |  | ||||||
| if [ -n "${ENABLE_EXPERIMENTAL_API:-}" ]; then | if [ -n "${ENABLE_EXPERIMENTAL_API:-}" ]; then | ||||||
|   | |||||||
| @@ -284,6 +284,7 @@ opencontrail_public_subnet: '$(echo "$OPENCONTRAIL_PUBLIC_SUBNET")' | |||||||
| enable_manifest_url: '$(echo "$ENABLE_MANIFEST_URL" | sed -e "s/'/''/g")' | enable_manifest_url: '$(echo "$ENABLE_MANIFEST_URL" | sed -e "s/'/''/g")' | ||||||
| manifest_url: '$(echo "$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")' | manifest_url_header: '$(echo "$MANIFEST_URL_HEADER" | sed -e "s/'/''/g")' | ||||||
|  | num_nodes: $(echo "${NUM_MINIONS}") | ||||||
| EOF | EOF | ||||||
|  |  | ||||||
|     if [ -n "${APISERVER_TEST_ARGS:-}" ]; then |     if [ -n "${APISERVER_TEST_ARGS:-}" ]; then | ||||||
|   | |||||||
| @@ -69,6 +69,7 @@ KUBELET_KEY: $(yaml-quote ${KUBELET_KEY_BASE64:-}) | |||||||
| KUBECFG_CERT: $(yaml-quote ${KUBECFG_CERT_BASE64:-}) | KUBECFG_CERT: $(yaml-quote ${KUBECFG_CERT_BASE64:-}) | ||||||
| KUBECFG_KEY: $(yaml-quote ${KUBECFG_KEY_BASE64:-}) | KUBECFG_KEY: $(yaml-quote ${KUBECFG_KEY_BASE64:-}) | ||||||
| KUBELET_APISERVER: $(yaml-quote ${KUBELET_APISERVER:-}) | KUBELET_APISERVER: $(yaml-quote ${KUBELET_APISERVER:-}) | ||||||
|  | NUM_MINIONS: $(yaml-quote ${NUM_MINIONS}) | ||||||
| EOF | EOF | ||||||
|   else |   else | ||||||
|     cat >>$file <<EOF |     cat >>$file <<EOF | ||||||
| @@ -86,6 +87,7 @@ LOGGING_DESTINATION=${LOGGING_DESTINATION:-} | |||||||
| ELASTICSEARCH_LOGGING_REPLICAS=${ELASTICSEARCH_LOGGING_REPLICAS:-} | ELASTICSEARCH_LOGGING_REPLICAS=${ELASTICSEARCH_LOGGING_REPLICAS:-} | ||||||
| ENABLE_CLUSTER_DNS=${ENABLE_CLUSTER_DNS:-false} | ENABLE_CLUSTER_DNS=${ENABLE_CLUSTER_DNS:-false} | ||||||
| ENABLE_CLUSTER_REGISTRY=${ENABLE_CLUSTER_REGISTRY:-false} | ENABLE_CLUSTER_REGISTRY=${ENABLE_CLUSTER_REGISTRY:-false} | ||||||
|  | NUM_MINIONS=${NUM_MINIONS} | ||||||
| DNS_REPLICAS=${DNS_REPLICAS:-} | DNS_REPLICAS=${DNS_REPLICAS:-} | ||||||
| DNS_SERVER_IP=${DNS_SERVER_IP:-} | DNS_SERVER_IP=${DNS_SERVER_IP:-} | ||||||
| DNS_DOMAIN=${DNS_DOMAIN:-} | DNS_DOMAIN=${DNS_DOMAIN:-} | ||||||
|   | |||||||
| @@ -91,6 +91,7 @@ KUBELET_APISERVER: $(yaml-quote ${KUBELET_APISERVER:-}) | |||||||
| ENABLE_MANIFEST_URL: $(yaml-quote ${ENABLE_MANIFEST_URL:-false}) | ENABLE_MANIFEST_URL: $(yaml-quote ${ENABLE_MANIFEST_URL:-false}) | ||||||
| MANIFEST_URL: $(yaml-quote ${MANIFEST_URL:-}) | MANIFEST_URL: $(yaml-quote ${MANIFEST_URL:-}) | ||||||
| MANIFEST_URL_HEADER: $(yaml-quote ${MANIFEST_URL_HEADER:-}) | MANIFEST_URL_HEADER: $(yaml-quote ${MANIFEST_URL_HEADER:-}) | ||||||
|  | NUM_MINIONS: $(yaml-quote ${NUM_MINIONS}) | ||||||
| EOF | EOF | ||||||
|     if [ -n "${APISERVER_TEST_ARGS:-}" ]; then |     if [ -n "${APISERVER_TEST_ARGS:-}" ]; then | ||||||
|       cat >>$file <<EOF |       cat >>$file <<EOF | ||||||
|   | |||||||
| @@ -23,6 +23,7 @@ addon-dir-create: | |||||||
|   file.recurse: |   file.recurse: | ||||||
|     - source: salt://kube-addons/cluster-monitoring/influxdb |     - source: salt://kube-addons/cluster-monitoring/influxdb | ||||||
|     - include_pat: E@(^.+\.yaml$|^.+\.json$) |     - include_pat: E@(^.+\.yaml$|^.+\.json$) | ||||||
|  |     - template: jinja | ||||||
|     - user: root |     - user: root | ||||||
|     - group: root |     - group: root | ||||||
|     - dir_mode: 755 |     - dir_mode: 755 | ||||||
| @@ -34,6 +35,7 @@ addon-dir-create: | |||||||
|   file.recurse: |   file.recurse: | ||||||
|     - source: salt://kube-addons/cluster-monitoring/google |     - source: salt://kube-addons/cluster-monitoring/google | ||||||
|     - include_pat: E@(^.+\.yaml$|^.+\.json$) |     - include_pat: E@(^.+\.yaml$|^.+\.json$) | ||||||
|  |     - template: jinja | ||||||
|     - user: root |     - user: root | ||||||
|     - group: root |     - group: root | ||||||
|     - dir_mode: 755 |     - dir_mode: 755 | ||||||
| @@ -45,6 +47,7 @@ addon-dir-create: | |||||||
|   file.recurse: |   file.recurse: | ||||||
|     - source: salt://kube-addons/cluster-monitoring/standalone |     - source: salt://kube-addons/cluster-monitoring/standalone | ||||||
|     - include_pat: E@(^.+\.yaml$|^.+\.json$) |     - include_pat: E@(^.+\.yaml$|^.+\.json$) | ||||||
|  |     - template: jinja | ||||||
|     - user: root |     - user: root | ||||||
|     - group: root |     - group: root | ||||||
|     - dir_mode: 755 |     - dir_mode: 755 | ||||||
| @@ -57,6 +60,7 @@ addon-dir-create: | |||||||
|     - source: salt://kube-addons/cluster-monitoring |     - source: salt://kube-addons/cluster-monitoring | ||||||
|     - include_pat: E@(^.+\.yaml$|^.+\.json$) |     - include_pat: E@(^.+\.yaml$|^.+\.json$) | ||||||
|     - exclude_pat: E@(^.+heapster-controller\.yaml$|^.+heapster-controller\.json$) |     - exclude_pat: E@(^.+heapster-controller\.yaml$|^.+heapster-controller\.json$) | ||||||
|  |     - template: jinja | ||||||
|     - user: root |     - user: root | ||||||
|     - group: root |     - group: root | ||||||
|     - dir_mode: 755 |     - dir_mode: 755 | ||||||
| @@ -196,4 +200,4 @@ kube-addons: | |||||||
|       - file: {{ pillar.get('systemd_system_path') }}/kube-addons.service |       - file: {{ pillar.get('systemd_system_path') }}/kube-addons.service | ||||||
| {% else %} | {% else %} | ||||||
|       - file: /etc/init.d/kube-addons |       - file: /etc/init.d/kube-addons | ||||||
| {% endif %} | {% endif %} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Brendan Burns
					Brendan Burns