CI: reduce VM resources requests to improve scheduling

reduce-vm-requests
ant31 2024-05-31 10:14:35 +02:00
parent dedc00661a
commit 2214071a82
15 changed files with 20 additions and 19 deletions

View File

@ -4,15 +4,14 @@
vm_cpu_cores: 2 vm_cpu_cores: 2
vm_cpu_sockets: 1 vm_cpu_sockets: 1
vm_cpu_threads: 2 vm_cpu_threads: 2
vm_memory: 2048Mi vm_memory: 2048
# Replace invalid characters so that we can use the branch name in kubernetes labels # Replace invalid characters so that we can use the branch name in kubernetes labels
branch_name_sane: "{{ branch | regex_replace('/', '-') }}" branch_name_sane: "{{ branch | regex_replace('/', '-') }}"
# Request/Limit allocation settings # Request/Limit allocation settings
cpu_allocation_ratio: 0.25
cpu_allocation_ratio: 0.5 memory_allocation_ratio: 0.5
memory_allocation_ratio: 1
# Default path for inventory # Default path for inventory
inventory_path: "/tmp/{{ test_name }}/inventory" inventory_path: "/tmp/{{ test_name }}/inventory"

View File

@ -4,6 +4,8 @@ kind: VirtualMachine
metadata: metadata:
name: "instance-{{ vm_id }}" name: "instance-{{ vm_id }}"
namespace: "{{ test_name }}" namespace: "{{ test_name }}"
annotations:
kubespray.com/ci.template-path: "tests/cloud_playbooks/roles/packet-ci/templates/vm.yml.j2"
labels: labels:
kubevirt.io/os: {{ cloud_image }} kubevirt.io/os: {{ cloud_image }}
spec: spec:
@ -34,10 +36,10 @@ spec:
threads: {{ vm_cpu_threads }} threads: {{ vm_cpu_threads }}
resources: resources:
requests: requests:
memory: {{ vm_memory * memory_allocation_ratio }} memory: "{{ vm_memory * memory_allocation_ratio }}Mi"
cpu: {{ vm_cpu_cores * cpu_allocation_ratio }} cpu: {{ vm_cpu_cores * cpu_allocation_ratio }}
limits: limits:
memory: {{ vm_memory }} memory: "{{ vm_memory }}Mi"
cpu: {{ vm_cpu_cores }} cpu: {{ vm_cpu_cores }}
networks: networks:
- name: default - name: default

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: almalinux-8 cloud_image: almalinux-8
mode: ha mode: ha
vm_memory: 3072Mi vm_memory: 3072
# Kubespray settings # Kubespray settings
calico_bpf_enabled: true calico_bpf_enabled: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: almalinux-8 cloud_image: almalinux-8
mode: default mode: default
vm_memory: 3072Mi vm_memory: 3072
# Kubespray settings # Kubespray settings
enable_nodelocaldns_secondary: true enable_nodelocaldns_secondary: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: almalinux-8 cloud_image: almalinux-8
mode: default mode: default
vm_memory: 3072Mi vm_memory: 3072
# Kubespray settings # Kubespray settings
metrics_server_enabled: true metrics_server_enabled: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: almalinux-8 cloud_image: almalinux-8
mode: default mode: default
vm_memory: 3072Mi vm_memory: 3072
# Use docker # Use docker
container_manager: docker container_manager: docker

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: almalinux-8 cloud_image: almalinux-8
mode: default mode: default
vm_memory: 3072Mi vm_memory: 3072
# Kubespray settings # Kubespray settings
kube_network_plugin: kube-ovn kube_network_plugin: kube-ovn

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: rockylinux-8 cloud_image: rockylinux-8
mode: default mode: default
vm_memory: 3072Mi vm_memory: 3072
# Kubespray settings # Kubespray settings
metrics_server_enabled: true metrics_server_enabled: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: rockylinux-9 cloud_image: rockylinux-9
mode: default mode: default
vm_memory: 3072Mi vm_memory: 3072
# Kubespray settings # Kubespray settings
metrics_server_enabled: true metrics_server_enabled: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: rockylinux-9 cloud_image: rockylinux-9
mode: default mode: default
vm_memory: 3072Mi vm_memory: 3072
# Kubespray settings # Kubespray settings
kube_network_plugin: cilium kube_network_plugin: cilium

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: ubuntu-2204 cloud_image: ubuntu-2204
mode: all-in-one mode: all-in-one
vm_memory: 1600Mi vm_memory: 1600
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: ubuntu-2204 cloud_image: ubuntu-2204
mode: all-in-one mode: all-in-one
vm_memory: 1600Mi vm_memory: 1600
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: ubuntu-2404 cloud_image: ubuntu-2404
mode: all-in-one mode: all-in-one
vm_memory: 1600Mi vm_memory: 1600
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: ubuntu-2404 cloud_image: ubuntu-2404
mode: all-in-one mode: all-in-one
vm_memory: 1600Mi vm_memory: 1600
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true

View File

@ -2,7 +2,7 @@
# Instance settings # Instance settings
cloud_image: ubuntu-2404 cloud_image: ubuntu-2404
mode: node-etcd-client mode: node-etcd-client
vm_memory: 1600Mi vm_memory: 1600
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true