Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix cluster-autoscaler-priority expander
  • Loading branch information
RobertLucian committed Jul 2, 2021
commit b3ca93bf9800534f57f635043abbee3c7110c30d
22 changes: 17 additions & 5 deletions manager/manifests/cluster-autoscaler.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,25 @@ metadata:
namespace: kube-system
data:
priorities: |-
{% for ng in config['node_groups']|reverse %}
{{ (loop.index0+1) * 10 }}:
{% if ng['spot'] %}
{% for p in range(1, 100) %}
{% set found = {'priority': False} %}
{% for ng in config['node_groups'] %}
{% if ng['priority'] == p %}
{%- if found.update({'priority':True}) %} {%- endif %}
{% endif %}
{% endfor %}
{% if found['priority'] %}
{{ 101-p }}:
{% endif %}
{% for ng in config['node_groups'] %}
{% if ng['priority'] == p %}
{% if ng['spot'] %}
- .*{{ 'cx-ws-' + ng['name'] }}.*
{% else %}
{% else %}
- .*{{ 'cx-wd-' + ng['name'] }}.*
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
---
apiVersion: apps/v1
Expand Down