KubeVirt Components

Resource limits

To ensure stable node resource allocation, SUSE Virtualization enforces default resource limits for KubeVirt components.

Component Resource Type CPU Limit Memory Limit

virt-api

Deployment

400m

1100Mi

virt-controller

Deployment

800m

1300Mi

virt-handler

DaemonSet

700m

1600Mi

Adjusting the resource limits for these components may be necessary as you scale your cluster. For example, insufficient memory can cause virt-handler pods to crash, leading to virtual machine migration failures.

Modifying resource limits

To ensure your changes persist across upgrades, modify the SUSE Virtualization ManagedChart resource directly rather than the KubeVirt resource. Changes to ManagedChart are automatically applied to KubeVirt.

You can retrieve the current default component configuration by running the following command on each node:

helm get values harvester -n harvester-system --all | yq '.kubevirt.spec.customizeComponents.patches'

Copy the output and modify the values as necessary.

- patch: '{"webhooks":[{"name":"kubevirt-validator.kubevirt.io","failurePolicy":"Ignore"},{"name":"kubevirt-update-validator.kubevirt.io","failurePolicy":"Ignore"}]}'
  resourceName: virt-operator-validator
  resourceType: ValidatingWebhookConfiguration
  type: strategic
- patch: '{"spec":{"template":{"spec":{"containers":[{"name":"virt-api", "resources":{"limits":{"cpu":"400m","memory":"1100Mi"}}}]}}}}'
  resourceName: virt-api
  resourceType: Deployment
  type: strategic
- patch: '{"spec":{"template":{"spec":{"containers":[{"name":"virt-controller", "resources":{"limits":{"cpu":"800m","memory":"1300Mi"}}}]}}}}'
  resourceName: virt-controller
  resourceType: Deployment
  type: strategic
- patch: '{"spec":{"template":{"spec":{"containers":[{"name":"virt-handler", "resources":{"limits":{"cpu":"700m","memory":"1600Mi"}}}]}}}}'
  resourceName: virt-handler
  resourceType: DaemonSet
  type: strategic

When patching ManagedChart, include all existing elements under customizeComponents.patches. This ensures that default configurations are preserved rather than overwritten.

The following example increases the CPU and memory limits for virt-handler:

kubectl patch managedchart harvester -n fleet-local --type=merge --patch '
spec:
  values:
    kubevirt:
      spec:
        customizeComponents:
          patches:
            - resourceName: virt-operator-validator
              resourceType: ValidatingWebhookConfiguration
              type: strategic
              patch: |
                {"webhooks":[{"name":"kubevirt-validator.kubevirt.io","failurePolicy":"Ignore"},{"name":"kubevirt-update-validator.kubevirt.io","failurePolicy":"Ignore"}]}
            - resourceName: virt-api
              resourceType: Deployment
              type: strategic
              patch: |
                {"spec":{"template":{"spec":{"containers":[{"name":"virt-api","resources":{"limits":{"cpu":"400m","memory":"1100Mi"}}}]}}}}
            - resourceName: virt-controller
              resourceType: Deployment
              type: strategic
              patch: |
                {"spec":{"template":{"spec":{"containers":[{"name":"virt-controller","resources":{"limits":{"cpu":"800m","memory":"1300Mi"}}}]}}}}
            - resourceName: virt-handler
              resourceType: DaemonSet
              type: strategic
              patch: |
                {"spec":{"template":{"spec":{"containers":[{"name":"virt-handler","resources":{"limits":{"cpu":"4","memory":"3200Mi"}}}]}}}}

Default resource limits may change in future releases. Once you customize ManagedChart values, you are responsible for reviewing and maintaining these configurations during future upgrades.