Koschei: just use millicores to avoid numeric operations

This commit is contained in:
Mikolaj Izdebski 2019-02-06 18:01:51 +01:00
parent cb36fd9ced
commit 076cd735d8
2 changed files with 10 additions and 10 deletions

View file

@ -43,15 +43,15 @@
template: backend-deployment.yml
objectname: "{{ item.name }}-deployment.yml"
service: "{{ item.name }}"
min_cpu: {{ item.cpu[0] }}
max_cpu: {{ item.cpu[1] }}
min_mem: {{ item.memory[0] }}
max_mem: {{ item.memory[1] }}
min_cpu: "{{ item.cpu[0] }}"
max_cpu: "{{ item.cpu[1] }}"
min_mem: "{{ item.memory[0] }}"
max_mem: "{{ item.memory[1] }}"
with_items:
- { name: polling, cpu: [ 1.0, 1.5 ], memory: [ 256, 512 ] }
- { name: scheduler, cpu: [ 0.2, 0.5 ], memory: [ 64, 128 ] }
- { name: build-resolver, cpu: [ 1.0, 1.5 ], memory: [ 1024, 4096 ] }
- { name: repo-resolver, cpu: [ 2.0, 8.0 ], memory: [ 1024, 4096 ] }
- { name: polling, cpu: [ 1000, 1500 ], memory: [ 256, 512 ] }
- { name: scheduler, cpu: [ 200, 500 ], memory: [ 64, 128 ] }
- { name: build-resolver, cpu: [ 1000, 1500 ], memory: [ 1024, 4096 ] }
- { name: repo-resolver, cpu: [ 2000, 8000 ], memory: [ 1024, 4096 ] }
loop_control:
label: "{{ item.name }}"

View file

@ -35,10 +35,10 @@ spec:
readOnly: true
resources:
requests:
cpu: "{{ (1000 * min_cpu) | int }}m"
cpu: "{{ min_cpu }}m"
memory: "{{ min_mem }}Mi"
limits:
cpu: "{{ (1000 * max_cpu) | int }}m"
cpu: "{{ max_cpu }}m"
memory: "{{ max_mem }}Mi"
volumes:
- name: config