Skip to content

Commit c482289

Browse files
authored
Make kubevirt's CPU allocation ratio configurable (#905)
Kubevirt's default cpu-to-vcpu ration is 1:10, which might be a bit extreme for some users. This patch introduces a new key in the Cozystack configmap, "cpu-allocation-ratio" where admins of Cozystack can specify an alternative value, if needed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for optionally configuring a CPU allocation ratio for KubeVirt deployments when the relevant setting is provided. - **Chores** - Improved configuration flexibility for KubeVirt by allowing dynamic injection of CPU allocation settings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 1e59e5f + 6106a9f commit c482289

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎packages/core/platform/bundles/paas-full.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ releases:
134134
namespace: cozy-kubevirt
135135
privileged: true
136136
dependsOn: [cilium,kubeovn,kubevirt-operator]
137+
{{- $cpuAllocationRatio := index $cozyConfig.data "cpu-allocation-ratio" }}
138+
{{- if $cpuAllocationRatio }}
139+
values:
140+
cpuAllocationRatio: {{ $cpuAllocationRatio }}
141+
{{- end }}
137142

138143
- name: kubevirt-instancetypes
139144
releaseName: kubevirt-instancetypes

‎packages/system/kubevirt/templates/kubevirt-cr.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ spec:
1010
commonInstancetypesDeployment:
1111
enabled: false
1212
developerConfiguration:
13+
{{- if .Values.cpuAllocationRatio }}
14+
cpuAllocationRatio: {{ .Values.cpuAllocationRatio }}
15+
{{- end }}
1316
featureGates:
1417
- HotplugVolumes
1518
- ExpandDisks

0 commit comments

Comments
 (0)