Skip to content

Commit d3aeb5e

Browse files
authored
Fix cluster-autoscaler-priority expander (#2309)
1 parent e05e77f commit d3aeb5e

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

manager/manifests/cluster-autoscaler.yaml.j2

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,25 @@ metadata:
137137
namespace: kube-system
138138
data:
139139
priorities: |-
140-
{% for ng in config['node_groups']|reverse %}
141-
{{ (loop.index0+1) * 10 }}:
142-
{% if ng['spot'] %}
140+
{% for p in range(1, 100) %}
141+
{% set found = {'priority': False} %}
142+
{% for ng in config['node_groups'] %}
143+
{% if ng['priority'] == p %}
144+
{%- if found.update({'priority':True}) %} {%- endif %}
145+
{% endif %}
146+
{% endfor %}
147+
{% if found['priority'] %}
148+
{{ 101-p }}:
149+
{% endif %}
150+
{% for ng in config['node_groups'] %}
151+
{% if ng['priority'] == p %}
152+
{% if ng['spot'] %}
143153
- .*{{ 'cx-ws-' + ng['name'] }}.*
144-
{% else %}
154+
{% else %}
145155
- .*{{ 'cx-wd-' + ng['name'] }}.*
146-
{% endif %}
156+
{% endif %}
157+
{% endif %}
158+
{% endfor %}
147159
{% endfor %}
148160
---
149161
apiVersion: apps/v1

0 commit comments

Comments
 (0)