From 6106a9fe51a721d85c14634572b8a85cfc469fe1 Mon Sep 17 00:00:00 2001 From: Timofei Larkin Date: Tue, 29 Apr 2025 16:13:15 +0300 Subject: [PATCH] Make kubevirt's CPU allocation ratio configurable 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. Signed-off-by: Timofei Larkin --- packages/core/platform/bundles/paas-full.yaml | 5 +++++ packages/system/kubevirt/templates/kubevirt-cr.yaml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/packages/core/platform/bundles/paas-full.yaml b/packages/core/platform/bundles/paas-full.yaml index 74806d9e..da5a0e8a 100644 --- a/packages/core/platform/bundles/paas-full.yaml +++ b/packages/core/platform/bundles/paas-full.yaml @@ -134,6 +134,11 @@ releases: namespace: cozy-kubevirt privileged: true dependsOn: [cilium,kubeovn,kubevirt-operator] + {{- $cpuAllocationRatio := index $cozyConfig.data "cpu-allocation-ratio" }} + {{- if $cpuAllocationRatio }} + values: + cpuAllocationRatio: {{ $cpuAllocationRatio }} + {{- end }} - name: kubevirt-instancetypes releaseName: kubevirt-instancetypes diff --git a/packages/system/kubevirt/templates/kubevirt-cr.yaml b/packages/system/kubevirt/templates/kubevirt-cr.yaml index 87889e42..b4ec5b70 100644 --- a/packages/system/kubevirt/templates/kubevirt-cr.yaml +++ b/packages/system/kubevirt/templates/kubevirt-cr.yaml @@ -10,6 +10,9 @@ spec: commonInstancetypesDeployment: enabled: false developerConfiguration: + {{- if .Values.cpuAllocationRatio }} + cpuAllocationRatio: {{ .Values.cpuAllocationRatio }} + {{- end }} featureGates: - HotplugVolumes - ExpandDisks