VirtualImage
Scope: Namespaced
Version: v1alpha2
This resource describes a virtual disk image to use as a data source for new VirtualDisk resources or an installation image (iso) that can be mounted into the VirtualMachine resource.
This resource cannot be modified once it has been created.
With this resource in the cluster, a container image is created and stored in a dedicated Deckhouse Virtualization Container Registry (DVCR) or PVC, with the data filled in from the source.
- apiVersion
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
- kind
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- metadata
- spec
Required value
- spec.dataSource
Required value
- spec.dataSource.containerImage
Use an image stored in an external container registry. Only registries with enabled TLS protocol are supported. To provide a custom Certificate Authority (CA) chain, use the
caBundle
field.- spec.dataSource.containerImage.caBundle
CA chain in Base64 format to verify the container registry.
Example:
caBundle: YWFhCg==
- spec.dataSource.containerImage.image
Required value
Path to the image in the container registry.
Pattern:
^(?P<name>(?:(?P<domain>(?:(?:localhost|[\w-]+(?:\.[\w-]+)+)(?::\d+)?)|[\w]+:\d+)/)?(?P<image>[a-z0-9_.-]+(?:/[a-z0-9_.-]+)*))(?::(?P<tag>[\w][\w.-]{0,127}))?(?:@(?P<digest>[A-Za-z][A-Za-z0-9]*(?:[+.-_][A-Za-z][A-Za-z0-9]*)*:[0-9a-fA-F]{32,}))?$
Example:
image: registry.example.com/images/slackware:15
- spec.dataSource.containerImage.imagePullSecret
- spec.dataSource.containerImage.imagePullSecret.name
Name of the secret keeping container registry credentials, which must be located in the same namespace.
- spec.dataSource.http
Fill the image with data from an external URL. The following schemas are supported:
- HTTP
- HTTPS
For HTTPS schema, there is an option to skip the TLS verification.
- spec.dataSource.http.caBundle
CA chain in Base64 format to verify the URL.
Example:
caBundle: YWFhCg==
- spec.dataSource.http.checksum
Checksum to verify integrity and consistency of the downloaded file. The file must match all specified checksums.
- spec.dataSource.http.checksum.md5
Pattern:
^[0-9a-fA-F]{32}$
Length:
32..32
Example:
md5: f3b59bed9f91e32fac1210184fcff6f5
- spec.dataSource.http.checksum.sha256
Pattern:
^[0-9a-fA-F]{64}$
Length:
64..64
Example:
sha256: 78be890d71dde316c412da2ce8332ba47b9ce7a29d573801d2777e01aa20b9b5
- spec.dataSource.http.url
Required value
URL of the file for creating an image. The following file formats are supported:
- qcow2
- vmdk
- vdi
- iso
- raw The file can be compressed into an archive in one of the following formats:
- gz
- xz
Pattern:
^http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+$
Example:
url: https://mirror.example.com/images/slackware-15.qcow.gz
- spec.dataSource.objectRef
Use an existing VirtualImage, ClusterVirtualImage, or VirtualDisk resource to create an image.
- spec.dataSource.objectRef.kind
Required value
Kind of an existing VirtualImage, ClusterVirtualImage, or VirtualDisk resource.
Allowed values:
ClusterVirtualImage
,VirtualImage
,VirtualDisk
- spec.dataSource.objectRef.name
Required value
Name of an existing VirtualImage, ClusterVirtualImage, or VirtualDisk resource.
- spec.dataSource.type
The following image sources are available for creating an image:
HTTP
: From a file published on an HTTP/HTTPS service at a given URL.ContainerImage
: From another image stored in a container registry.ObjectRef
: From an existing resource.Upload
: From data uploaded by the user via a special interface.
Allowed values:
HTTP
,ContainerImage
,ObjectRef
,Upload
- spec.persistentVolumeClaim
Settings for creating PVCs to store an image with the storage type
PersistentVolumeClaim
.- spec.persistentVolumeClaim.storageClassName
Name of the StorageClass required by the claim. For details on using StorageClass for PVC, refer to — https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1.
When creating an image with the
PersistentVolumeClaim
storage type, the user can specify the required StorageClass. If not specified, the default StorageClass will be used.
- spec.storage
Required value
Storage type to keep the image for the current virtualization setup.
ContainerRegistry
: Use the DVCR container registry. In this case, images are downloaded to a container and then to DVCR (shipped with the virtualization module).PersistentVolumeClaim
: Use a PVC.Kubernetes
: A deprecated storage type. Not recommended for use and may be removed in future versions. UsePersistentVolumeClaim
instead.
Default:
"ContainerRegistry"
Allowed values:
ContainerRegistry
,Kubernetes
,PersistentVolumeClaim