Files
Timofei Larkin 79b2f56058 feat(vm-disk): let an http source carry header Secrets and a CA ConfigMap
An image behind an authenticated endpoint could not be imported: the
http source took a bare URL, so the only way to hand CDI credentials
was a pre-signed URL that anyone holding it could use until it expired.

The source gains secretExtraHeaders, the names of Secrets in the release
namespace each holding one extra request header, and certConfigMap, a
ConfigMap with the CA bundle to trust, both passed to the DataVolume as
CDI defines them. The immutability guard treats a stored http source
with these keys as chart-shaped, so a later change to them is refused
like a URL change; a stored key the chart never renders still marks a
foreign source it leaves alone.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-09-16 12:04:44 +03:00
..
2025-09-18 16:27:38 +02:00
2024-10-16 18:35:30 +02:00
2025-09-24 12:32:37 +02:00

Virtual Machine Disk

A Virtual Machine Disk

storageClass and source are annotated as immutable in the chart schema — see docs/storage-immutability.md for the contract and which consumers enforce it. DataVolume.spec is immutable in CDI, so the chart also fails the release on an attempted storageClass/source edit of an existing disk rather than silently reusing the old spec; delete and recreate the disk to change either field.

bindImmediately is on by default, so a disk's volume is provisioned when the disk is created rather than deferred to the first consumer. That default exists because a VMDisk is a standalone object with a lifecycle of its own: on a WaitForFirstConsumer StorageClass a disk that no VM has attached yet would otherwise never populate at all. It costs something on a node-pinned class such as local, where the CDI worker pod becomes the first consumer and the volume lands where that pod was scheduled rather than where the VM will run, so a VM whose placement is constrained (a nodeSelector, a resource request only one node satisfies, or the Windows affinity applied by _cluster.scheduling.dedicatedNodesForWindowsVMs) can stay unschedulable against a node-affinity conflict, and storageClass is immutable so the only exit is deleting and recreating the disk. Turn bindImmediately off for a disk a VMInstance will consume on such a class: KubeVirt then renders a temporary launcher pod carrying the VM's own affinity and node selector, and the volume binds where the VM can actually run. The chart default replicated binds Immediate regardless, so neither setting changes anything there.

Parameters

Common parameters

Name Description Type Value
source The source image location used to create a disk. object {}
source.image Use image by name from default collection. *object null
source.image.name Name of the image to use. string ""
source.upload Upload local image. *object null
source.http Download image from an HTTP source. *object null
source.http.url URL to download the image. string ""
source.http.secretExtraHeaders Names of Secrets in the release namespace, each holding one extra HTTP header for the download in every value (Authorization: Bearer ..., for example). Passed to the DataVolume as secretExtraHeaders, so the header never appears in the object itself. []string []
source.http.certConfigMap Name of a ConfigMap in the release namespace holding the CA bundle to trust for the download, for a source behind a private CA. Passed to the DataVolume as certConfigMap. string ""
source.disk Clone an existing vm-disk. *object null
source.disk.name Name of the vm-disk to clone. string ""
optical Defines if disk should be considered optical. bool false
storage The size of the disk allocated for the virtual machine. quantity 5Gi
storageClass StorageClass used to store the data. string replicated
bindImmediately Provision the volume at disk creation instead of waiting for a consumer. bool true