Adding initial kubevirt support

This commit is contained in:
2024-04-15 16:18:28 +02:00
parent 05ce097727
commit 32bc211cb6
136 changed files with 42922 additions and 227 deletions

View File

@@ -0,0 +1,73 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: migrationpolicies.migrations.kubevirt.io
spec:
conversion:
strategy: None
group: migrations.kubevirt.io
names:
categories:
- all
kind: MigrationPolicy
listKind: MigrationPolicyList
plural: migrationpolicies
singular: migrationpolicy
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: MigrationPolicy holds migration policy (i.e. configurations) to apply to a VM or group of VMs
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
properties:
allowAutoConverge:
type: boolean
allowPostCopy:
type: boolean
bandwidthPerMigration:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
completionTimeoutPerGiB:
format: int64
type: integer
selectors:
properties:
namespaceSelector:
additionalProperties:
type: string
type: object
virtualMachineInstanceSelector:
additionalProperties:
type: string
type: object
type: object
required:
- selectors
type: object
status:
nullable: true
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}

View File

@@ -0,0 +1,154 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: virtualmachineclones.clone.kubevirt.io
spec:
conversion:
strategy: None
group: clone.kubevirt.io
names:
categories:
- all
kind: VirtualMachineClone
listKind: VirtualMachineCloneList
plural: virtualmachineclones
shortNames:
- vmclone
- vmclones
singular: virtualmachineclone
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .spec.source.name
name: SourceVirtualMachine
type: string
- jsonPath: .spec.target.name
name: TargetVirtualMachine
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: VirtualMachineClone is a CRD that clones one VM into another.
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
properties:
annotationFilters:
items:
type: string
type: array
x-kubernetes-list-type: atomic
labelFilters:
items:
type: string
type: array
x-kubernetes-list-type: atomic
newMacAddresses:
additionalProperties:
type: string
description: NewMacAddresses manually sets that target interfaces' mac addresses. The key is the interface name and the value is the new mac address. If this field is not specified, a new MAC address will be generated automatically, as for any interface that is not included in this map.
type: object
newSMBiosSerial:
description: NewSMBiosSerial manually sets that target's SMbios serial. If this field is not specified, a new serial will be generated automatically.
type: string
source:
description: TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
target:
description: If the target is not provided, a random name would be generated for the target. The target's name can be viewed by inspecting status "TargetName" field below.
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
required:
- source
type: object
status:
properties:
conditions:
items:
description: Condition defines conditions
properties:
lastProbeTime:
format: date-time
nullable: true
type: string
lastTransitionTime:
format: date-time
nullable: true
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
description: ConditionType is the const type for Conditions
type: string
required:
- status
- type
type: object
type: array
x-kubernetes-list-type: atomic
creationTime:
format: date-time
nullable: true
type: string
phase:
type: string
restoreName:
nullable: true
type: string
snapshotName:
nullable: true
type: string
targetName:
nullable: true
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}

View File

@@ -0,0 +1,487 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: virtualmachineclusterinstancetypes.instancetype.kubevirt.io
spec:
conversion:
strategy: None
group: instancetype.kubevirt.io
names:
kind: VirtualMachineClusterInstancetype
listKind: VirtualMachineClusterInstancetypeList
plural: virtualmachineclusterinstancetypes
shortNames:
- vmclusterinstancetype
- vmclusterinstancetypes
- vmcf
- vmcfs
singular: virtualmachineclusterinstancetype
scope: Cluster
versions:
- deprecated: true
deprecationWarning: instancetype.kubevirt.io/v1alpha1 VirtualMachineClusterInstanceTypes is now deprecated and will be removed in v1.
name: v1alpha1
schema:
openAPIV3Schema:
description: VirtualMachineClusterInstancetype is a cluster scoped version of VirtualMachineInstancetype resource.
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: Required spec describing the instancetype
properties:
cpu:
description: Required CPU related attributes of the instancetype.
properties:
dedicatedCPUPlacement:
description: DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.
type: boolean
guest:
description: "Required number of vCPUs to expose to the guest. \n The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets."
format: int32
type: integer
isolateEmulatorThread:
description: IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.
type: boolean
model:
description: Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like "host-passthrough" to get the same CPU as the node and "host-model" to get CPU closest to the node one. Defaults to host-model.
type: string
numa:
description: NUMA allows specifying settings for the guest NUMA topology
properties:
guestMappingPassthrough:
description: GuestMappingPassthrough will create an efficient guest topology based on host CPUs exclusively assigned to a pod. The created topology ensures that memory and CPUs on the virtual numa nodes never cross boundaries of host numa nodes.
type: object
type: object
realtime:
description: Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads
properties:
mask:
description: 'Mask defines the vcpu mask expression that defines which vcpus are used for realtime. Format matches libvirt''s expressions. Example: "0-3,^1","0,2,3","2-3"'
type: string
type: object
required:
- guest
type: object
gpus:
description: Optionally defines any GPU devices associated with the instancetype.
items:
properties:
deviceName:
type: string
name:
description: Name of the GPU device as exposed by a device plugin
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
virtualGPUOptions:
properties:
display:
properties:
enabled:
description: Enabled determines if a display addapter backed by a vGPU should be enabled or disabled on the guest. Defaults to true.
type: boolean
ramFB:
description: Enables a boot framebuffer, until the guest OS loads a real GPU driver Defaults to true.
properties:
enabled:
description: Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.
type: boolean
type: object
type: object
type: object
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
hostDevices:
description: Optionally defines any HostDevices associated with the instancetype.
items:
properties:
deviceName:
description: DeviceName is the resource name of the host device exposed by a device plugin
type: string
name:
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
ioThreadsPolicy:
description: Optionally defines the IOThreadsPolicy to be used by the instancetype.
type: string
launchSecurity:
description: Optionally defines the LaunchSecurity to be used by the instancetype.
properties:
sev:
description: AMD Secure Encrypted Virtualization (SEV).
properties:
policy:
description: 'Guest policy flags as defined in AMD SEV API specification. Note: due to security reasons it is not allowed to enable guest debugging. Therefore NoDebug flag is not exposed to users and is always true.'
properties:
encryptedState:
description: SEV-ES is required. Defaults to false.
type: boolean
type: object
type: object
type: object
memory:
description: Required Memory related attributes of the instancetype.
properties:
guest:
anyOf:
- type: integer
- type: string
description: Required amount of memory which is visible inside the guest OS.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
hugepages:
description: Optionally enables the use of hugepages for the VirtualMachineInstance instead of regular memory.
properties:
pageSize:
description: PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.
type: string
type: object
overcommitPercent:
description: OvercommitPercent is the percentage of the guest memory which will be overcommitted. This means that the VMIs parent pod (virt-launcher) will request less physical memory by a factor specified by the OvercommitPercent. Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 0
maximum: 100
minimum: 0
type: integer
required:
- guest
type: object
required:
- cpu
- memory
type: object
required:
- spec
type: object
served: true
storage: false
- deprecated: true
deprecationWarning: instancetype.kubevirt.io/v1alpha2 VirtualMachineClusterInstanceTypes is now deprecated and will be removed in v1.
name: v1alpha2
schema:
openAPIV3Schema:
description: VirtualMachineClusterInstancetype is a cluster scoped version of VirtualMachineInstancetype resource.
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: Required spec describing the instancetype
properties:
cpu:
description: Required CPU related attributes of the instancetype.
properties:
dedicatedCPUPlacement:
description: DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.
type: boolean
guest:
description: "Required number of vCPUs to expose to the guest. \n The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets."
format: int32
type: integer
isolateEmulatorThread:
description: IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.
type: boolean
model:
description: Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like "host-passthrough" to get the same CPU as the node and "host-model" to get CPU closest to the node one. Defaults to host-model.
type: string
numa:
description: NUMA allows specifying settings for the guest NUMA topology
properties:
guestMappingPassthrough:
description: GuestMappingPassthrough will create an efficient guest topology based on host CPUs exclusively assigned to a pod. The created topology ensures that memory and CPUs on the virtual numa nodes never cross boundaries of host numa nodes.
type: object
type: object
realtime:
description: Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads
properties:
mask:
description: 'Mask defines the vcpu mask expression that defines which vcpus are used for realtime. Format matches libvirt''s expressions. Example: "0-3,^1","0,2,3","2-3"'
type: string
type: object
required:
- guest
type: object
gpus:
description: Optionally defines any GPU devices associated with the instancetype.
items:
properties:
deviceName:
type: string
name:
description: Name of the GPU device as exposed by a device plugin
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
virtualGPUOptions:
properties:
display:
properties:
enabled:
description: Enabled determines if a display addapter backed by a vGPU should be enabled or disabled on the guest. Defaults to true.
type: boolean
ramFB:
description: Enables a boot framebuffer, until the guest OS loads a real GPU driver Defaults to true.
properties:
enabled:
description: Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.
type: boolean
type: object
type: object
type: object
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
hostDevices:
description: Optionally defines any HostDevices associated with the instancetype.
items:
properties:
deviceName:
description: DeviceName is the resource name of the host device exposed by a device plugin
type: string
name:
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
ioThreadsPolicy:
description: Optionally defines the IOThreadsPolicy to be used by the instancetype.
type: string
launchSecurity:
description: Optionally defines the LaunchSecurity to be used by the instancetype.
properties:
sev:
description: AMD Secure Encrypted Virtualization (SEV).
properties:
policy:
description: 'Guest policy flags as defined in AMD SEV API specification. Note: due to security reasons it is not allowed to enable guest debugging. Therefore NoDebug flag is not exposed to users and is always true.'
properties:
encryptedState:
description: SEV-ES is required. Defaults to false.
type: boolean
type: object
type: object
type: object
memory:
description: Required Memory related attributes of the instancetype.
properties:
guest:
anyOf:
- type: integer
- type: string
description: Required amount of memory which is visible inside the guest OS.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
hugepages:
description: Optionally enables the use of hugepages for the VirtualMachineInstance instead of regular memory.
properties:
pageSize:
description: PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.
type: string
type: object
overcommitPercent:
description: OvercommitPercent is the percentage of the guest memory which will be overcommitted. This means that the VMIs parent pod (virt-launcher) will request less physical memory by a factor specified by the OvercommitPercent. Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 0
maximum: 100
minimum: 0
type: integer
required:
- guest
type: object
required:
- cpu
- memory
type: object
required:
- spec
type: object
served: true
storage: false
- name: v1beta1
schema:
openAPIV3Schema:
description: VirtualMachineClusterInstancetype is a cluster scoped version of VirtualMachineInstancetype resource.
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: Required spec describing the instancetype
properties:
cpu:
description: Required CPU related attributes of the instancetype.
properties:
dedicatedCPUPlacement:
description: DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.
type: boolean
guest:
description: "Required number of vCPUs to expose to the guest. \n The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets."
format: int32
type: integer
isolateEmulatorThread:
description: IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.
type: boolean
model:
description: Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like "host-passthrough" to get the same CPU as the node and "host-model" to get CPU closest to the node one. Defaults to host-model.
type: string
numa:
description: NUMA allows specifying settings for the guest NUMA topology
properties:
guestMappingPassthrough:
description: GuestMappingPassthrough will create an efficient guest topology based on host CPUs exclusively assigned to a pod. The created topology ensures that memory and CPUs on the virtual numa nodes never cross boundaries of host numa nodes.
type: object
type: object
realtime:
description: Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads
properties:
mask:
description: 'Mask defines the vcpu mask expression that defines which vcpus are used for realtime. Format matches libvirt''s expressions. Example: "0-3,^1","0,2,3","2-3"'
type: string
type: object
required:
- guest
type: object
gpus:
description: Optionally defines any GPU devices associated with the instancetype.
items:
properties:
deviceName:
type: string
name:
description: Name of the GPU device as exposed by a device plugin
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
virtualGPUOptions:
properties:
display:
properties:
enabled:
description: Enabled determines if a display addapter backed by a vGPU should be enabled or disabled on the guest. Defaults to true.
type: boolean
ramFB:
description: Enables a boot framebuffer, until the guest OS loads a real GPU driver Defaults to true.
properties:
enabled:
description: Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.
type: boolean
type: object
type: object
type: object
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
hostDevices:
description: Optionally defines any HostDevices associated with the instancetype.
items:
properties:
deviceName:
description: DeviceName is the resource name of the host device exposed by a device plugin
type: string
name:
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
ioThreadsPolicy:
description: Optionally defines the IOThreadsPolicy to be used by the instancetype.
type: string
launchSecurity:
description: Optionally defines the LaunchSecurity to be used by the instancetype.
properties:
sev:
description: AMD Secure Encrypted Virtualization (SEV).
properties:
policy:
description: 'Guest policy flags as defined in AMD SEV API specification. Note: due to security reasons it is not allowed to enable guest debugging. Therefore NoDebug flag is not exposed to users and is always true.'
properties:
encryptedState:
description: SEV-ES is required. Defaults to false.
type: boolean
type: object
type: object
type: object
memory:
description: Required Memory related attributes of the instancetype.
properties:
guest:
anyOf:
- type: integer
- type: string
description: Required amount of memory which is visible inside the guest OS.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
hugepages:
description: Optionally enables the use of hugepages for the VirtualMachineInstance instead of regular memory.
properties:
pageSize:
description: PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.
type: string
type: object
overcommitPercent:
description: OvercommitPercent is the percentage of the guest memory which will be overcommitted. This means that the VMIs parent pod (virt-launcher) will request less physical memory by a factor specified by the OvercommitPercent. Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 0
maximum: 100
minimum: 0
type: integer
required:
- guest
type: object
required:
- cpu
- memory
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -0,0 +1,259 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
kubevirt.io/generation: "1"
kubevirt.io/install-strategy-identifier: c51bc47ef3eccba54f764552d24801eb8388b36e
kubevirt.io/install-strategy-registry: quay.io/kubevirt
kubevirt.io/install-strategy-version: v1.0.1
generation: 1
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: virtualmachineexports.export.kubevirt.io
spec:
conversion:
strategy: None
group: export.kubevirt.io
names:
categories:
- all
kind: VirtualMachineExport
listKind: VirtualMachineExportList
plural: virtualmachineexports
shortNames:
- vmexport
- vmexports
singular: virtualmachineexport
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.source.kind
name: SourceKind
type: string
- jsonPath: .spec.source.name
name: SourceName
type: string
- jsonPath: .status.phase
name: Phase
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: VirtualMachineExport defines the operation of exporting a VM source
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: VirtualMachineExportSpec is the spec for a VirtualMachineExport resource
properties:
source:
description: TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
tokenSecretRef:
description: TokenSecretRef is the name of the custom-defined secret that contains the token used by the export server pod
type: string
ttlDuration:
description: ttlDuration limits the lifetime of an export If this field is set, after this duration has passed from counting from CreationTimestamp, the export is eligible to be automatically deleted. If this field is omitted, a reasonable default is applied.
type: string
required:
- source
type: object
status:
description: VirtualMachineExportStatus is the status for a VirtualMachineExport resource
properties:
conditions:
items:
description: Condition defines conditions
properties:
lastProbeTime:
format: date-time
nullable: true
type: string
lastTransitionTime:
format: date-time
nullable: true
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
description: ConditionType is the const type for Conditions
type: string
required:
- status
- type
type: object
type: array
x-kubernetes-list-type: atomic
links:
description: VirtualMachineExportLinks contains the links that point the exported VM resources
properties:
external:
description: VirtualMachineExportLink contains a list of volumes available for export, as well as the URLs to obtain these volumes
properties:
cert:
description: Cert is the public CA certificate base64 encoded
type: string
manifests:
description: Manifests is a list of available manifests for the export
items:
description: VirtualMachineExportManifest contains the type and URL of the exported manifest
properties:
type:
description: Type is the type of manifest returned
type: string
url:
description: Url is the url of the endpoint that returns the manifest
type: string
required:
- type
- url
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
volumes:
description: Volumes is a list of available volumes to export
items:
description: VirtualMachineExportVolume contains the name and available formats for the exported volume
properties:
formats:
items:
description: VirtualMachineExportVolumeFormat contains the format type and URL to get the volume in that format
properties:
format:
description: Format is the format of the image at the specified URL
type: string
url:
description: Url is the url that contains the volume in the format specified
type: string
required:
- format
- url
type: object
type: array
x-kubernetes-list-map-keys:
- format
x-kubernetes-list-type: map
name:
description: Name is the name of the exported volume
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
required:
- cert
type: object
internal:
description: VirtualMachineExportLink contains a list of volumes available for export, as well as the URLs to obtain these volumes
properties:
cert:
description: Cert is the public CA certificate base64 encoded
type: string
manifests:
description: Manifests is a list of available manifests for the export
items:
description: VirtualMachineExportManifest contains the type and URL of the exported manifest
properties:
type:
description: Type is the type of manifest returned
type: string
url:
description: Url is the url of the endpoint that returns the manifest
type: string
required:
- type
- url
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
volumes:
description: Volumes is a list of available volumes to export
items:
description: VirtualMachineExportVolume contains the name and available formats for the exported volume
properties:
formats:
items:
description: VirtualMachineExportVolumeFormat contains the format type and URL to get the volume in that format
properties:
format:
description: Format is the format of the image at the specified URL
type: string
url:
description: Url is the url that contains the volume in the format specified
type: string
required:
- format
- url
type: object
type: array
x-kubernetes-list-map-keys:
- format
x-kubernetes-list-type: map
name:
description: Name is the name of the exported volume
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
required:
- cert
type: object
type: object
phase:
description: VirtualMachineExportPhase is the current phase of the VirtualMachineExport
type: string
serviceName:
description: ServiceName is the name of the service created associated with the Virtual Machine export. It will be used to create the internal URLs for downloading the images
type: string
tokenSecretRef:
description: TokenSecretRef is the name of the secret that contains the token used by the export server pod
type: string
ttlExpirationTime:
description: The time at which the VM Export will be completely removed according to specified TTL Formula is CreationTimestamp + TTL
format: date-time
type: string
virtualMachineName:
description: VirtualMachineName shows the name of the source virtual machine if the source is either a VirtualMachine or a VirtualMachineSnapshot. This is mainly to easily identify the source VirtualMachine in case of a VirtualMachineSnapshot
type: string
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -0,0 +1,432 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
kubevirt.io/generation: "1"
kubevirt.io/install-strategy-identifier: c51bc47ef3eccba54f764552d24801eb8388b36e
kubevirt.io/install-strategy-registry: quay.io/kubevirt
kubevirt.io/install-strategy-version: v1.0.1
generation: 1
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: virtualmachineinstancemigrations.kubevirt.io
spec:
conversion:
strategy: None
group: kubevirt.io
names:
categories:
- all
kind: VirtualMachineInstanceMigration
listKind: VirtualMachineInstanceMigrationList
plural: virtualmachineinstancemigrations
shortNames:
- vmim
- vmims
singular: virtualmachineinstancemigration
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: The current phase of VM instance migration
jsonPath: .status.phase
name: Phase
type: string
- description: The name of the VMI to perform the migration on
jsonPath: .spec.vmiName
name: VMI
type: string
name: v1
schema:
openAPIV3Schema:
description: VirtualMachineInstanceMigration represents the object tracking a VMI's migration to another host in the cluster
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
properties:
vmiName:
description: The name of the VMI to perform the migration on. VMI must exist in the migration objects namespace
type: string
type: object
status:
description: VirtualMachineInstanceMigration reprents information pertaining to a VMI's migration.
properties:
conditions:
items:
properties:
lastProbeTime:
format: date-time
nullable: true
type: string
lastTransitionTime:
format: date-time
nullable: true
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
type: string
required:
- status
- type
type: object
type: array
migrationState:
description: Represents the status of a live migration
properties:
abortRequested:
description: Indicates that the migration has been requested to abort
type: boolean
abortStatus:
description: Indicates the final status of the live migration abortion
type: string
completed:
description: Indicates the migration completed
type: boolean
endTimestamp:
description: The time the migration action ended
format: date-time
nullable: true
type: string
failed:
description: Indicates that the migration failed
type: boolean
migrationConfiguration:
description: Migration configurations to apply
properties:
allowAutoConverge:
description: AllowAutoConverge allows the platform to compromise performance/availability of VMIs to guarantee successful VMI live migrations. Defaults to false
type: boolean
allowPostCopy:
description: AllowPostCopy enables post-copy live migrations. Such migrations allow even the busiest VMIs to successfully live-migrate. However, events like a network failure can cause a VMI crash. If set to true, migrations will still start in pre-copy, but switch to post-copy when CompletionTimeoutPerGiB triggers. Defaults to false
type: boolean
bandwidthPerMigration:
anyOf:
- type: integer
- type: string
description: BandwidthPerMigration limits the amount of network bandwidth live migrations are allowed to use. The value is in quantity per second. Defaults to 0 (no limit)
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
completionTimeoutPerGiB:
description: CompletionTimeoutPerGiB is the maximum number of seconds per GiB a migration is allowed to take. If a live-migration takes longer to migrate than this value multiplied by the size of the VMI, the migration will be cancelled, unless AllowPostCopy is true. Defaults to 800
format: int64
type: integer
disableTLS:
description: When set to true, DisableTLS will disable the additional layer of live migration encryption provided by KubeVirt. This is usually a bad idea. Defaults to false
type: boolean
matchSELinuxLevelOnMigration:
description: By default, the SELinux level of target virt-launcher pods is forced to the level of the source virt-launcher. When set to true, MatchSELinuxLevelOnMigration lets the CRI auto-assign a random level to the target. That will ensure the target virt-launcher doesn't share categories with another pod on the node. However, migrations will fail when using RWX volumes that don't automatically deal with SELinux levels.
type: boolean
network:
description: Network is the name of the CNI network to use for live migrations. By default, migrations go through the pod network.
type: string
nodeDrainTaintKey:
description: 'NodeDrainTaintKey defines the taint key that indicates a node should be drained. Note: this option relies on the deprecated node taint feature. Default: kubevirt.io/drain'
type: string
parallelMigrationsPerCluster:
description: ParallelMigrationsPerCluster is the total number of concurrent live migrations allowed cluster-wide. Defaults to 5
format: int32
type: integer
parallelOutboundMigrationsPerNode:
description: ParallelOutboundMigrationsPerNode is the maximum number of concurrent outgoing live migrations allowed per node. Defaults to 2
format: int32
type: integer
progressTimeout:
description: ProgressTimeout is the maximum number of seconds a live migration is allowed to make no progress. Hitting this timeout means a migration transferred 0 data for that many seconds. The migration is then considered stuck and therefore cancelled. Defaults to 150
format: int64
type: integer
unsafeMigrationOverride:
description: UnsafeMigrationOverride allows live migrations to occur even if the compatibility check indicates the migration will be unsafe to the guest. Defaults to false
type: boolean
type: object
migrationPolicyName:
description: Name of the migration policy. If string is empty, no policy is matched
type: string
migrationUid:
description: The VirtualMachineInstanceMigration object associated with this migration
type: string
mode:
description: Lets us know if the vmi is currently running pre or post copy migration
type: string
sourceNode:
description: The source node that the VMI originated on
type: string
startTimestamp:
description: The time the migration action began
format: date-time
nullable: true
type: string
targetAttachmentPodUID:
description: The UID of the target attachment pod for hotplug volumes
type: string
targetCPUSet:
description: If the VMI requires dedicated CPUs, this field will hold the dedicated CPU set on the target node
items:
type: integer
type: array
x-kubernetes-list-type: atomic
targetDirectMigrationNodePorts:
additionalProperties:
type: integer
description: The list of ports opened for live migration on the destination node
type: object
targetNode:
description: The target node that the VMI is moving to
type: string
targetNodeAddress:
description: The address of the target node to use for the migration
type: string
targetNodeDomainDetected:
description: The Target Node has seen the Domain Start Event
type: boolean
targetNodeDomainReadyTimestamp:
description: The timestamp at which the target node detects the domain is active
format: date-time
type: string
targetNodeTopology:
description: If the VMI requires dedicated CPUs, this field will hold the numa topology on the target node
type: string
targetPod:
description: The target pod that the VMI is moving to
type: string
type: object
phase:
description: VirtualMachineInstanceMigrationPhase is a label for the condition of a VirtualMachineInstanceMigration at the current time.
type: string
phaseTransitionTimestamps:
description: PhaseTransitionTimestamp is the timestamp of when the last phase change occurred
items:
description: VirtualMachineInstanceMigrationPhaseTransitionTimestamp gives a timestamp in relation to when a phase is set on a vmi
properties:
phase:
description: Phase is the status of the VirtualMachineInstanceMigrationPhase in kubernetes world. It is not the VirtualMachineInstanceMigrationPhase status, but partially correlates to it.
type: string
phaseTransitionTimestamp:
description: PhaseTransitionTimestamp is the timestamp of when the phase change occurred
format: date-time
type: string
type: object
type: array
x-kubernetes-list-type: atomic
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
- additionalPrinterColumns:
- description: The current phase of VM instance migration
jsonPath: .status.phase
name: Phase
type: string
- description: The name of the VMI to perform the migration on
jsonPath: .spec.vmiName
name: VMI
type: string
deprecated: true
deprecationWarning: kubevirt.io/v1alpha3 is now deprecated and will be removed in a future release.
name: v1alpha3
schema:
openAPIV3Schema:
description: VirtualMachineInstanceMigration represents the object tracking a VMI's migration to another host in the cluster
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
properties:
vmiName:
description: The name of the VMI to perform the migration on. VMI must exist in the migration objects namespace
type: string
type: object
status:
description: VirtualMachineInstanceMigration reprents information pertaining to a VMI's migration.
properties:
conditions:
items:
properties:
lastProbeTime:
format: date-time
nullable: true
type: string
lastTransitionTime:
format: date-time
nullable: true
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
type: string
required:
- status
- type
type: object
type: array
migrationState:
description: Represents the status of a live migration
properties:
abortRequested:
description: Indicates that the migration has been requested to abort
type: boolean
abortStatus:
description: Indicates the final status of the live migration abortion
type: string
completed:
description: Indicates the migration completed
type: boolean
endTimestamp:
description: The time the migration action ended
format: date-time
nullable: true
type: string
failed:
description: Indicates that the migration failed
type: boolean
migrationConfiguration:
description: Migration configurations to apply
properties:
allowAutoConverge:
description: AllowAutoConverge allows the platform to compromise performance/availability of VMIs to guarantee successful VMI live migrations. Defaults to false
type: boolean
allowPostCopy:
description: AllowPostCopy enables post-copy live migrations. Such migrations allow even the busiest VMIs to successfully live-migrate. However, events like a network failure can cause a VMI crash. If set to true, migrations will still start in pre-copy, but switch to post-copy when CompletionTimeoutPerGiB triggers. Defaults to false
type: boolean
bandwidthPerMigration:
anyOf:
- type: integer
- type: string
description: BandwidthPerMigration limits the amount of network bandwidth live migrations are allowed to use. The value is in quantity per second. Defaults to 0 (no limit)
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
completionTimeoutPerGiB:
description: CompletionTimeoutPerGiB is the maximum number of seconds per GiB a migration is allowed to take. If a live-migration takes longer to migrate than this value multiplied by the size of the VMI, the migration will be cancelled, unless AllowPostCopy is true. Defaults to 800
format: int64
type: integer
disableTLS:
description: When set to true, DisableTLS will disable the additional layer of live migration encryption provided by KubeVirt. This is usually a bad idea. Defaults to false
type: boolean
matchSELinuxLevelOnMigration:
description: By default, the SELinux level of target virt-launcher pods is forced to the level of the source virt-launcher. When set to true, MatchSELinuxLevelOnMigration lets the CRI auto-assign a random level to the target. That will ensure the target virt-launcher doesn't share categories with another pod on the node. However, migrations will fail when using RWX volumes that don't automatically deal with SELinux levels.
type: boolean
network:
description: Network is the name of the CNI network to use for live migrations. By default, migrations go through the pod network.
type: string
nodeDrainTaintKey:
description: 'NodeDrainTaintKey defines the taint key that indicates a node should be drained. Note: this option relies on the deprecated node taint feature. Default: kubevirt.io/drain'
type: string
parallelMigrationsPerCluster:
description: ParallelMigrationsPerCluster is the total number of concurrent live migrations allowed cluster-wide. Defaults to 5
format: int32
type: integer
parallelOutboundMigrationsPerNode:
description: ParallelOutboundMigrationsPerNode is the maximum number of concurrent outgoing live migrations allowed per node. Defaults to 2
format: int32
type: integer
progressTimeout:
description: ProgressTimeout is the maximum number of seconds a live migration is allowed to make no progress. Hitting this timeout means a migration transferred 0 data for that many seconds. The migration is then considered stuck and therefore cancelled. Defaults to 150
format: int64
type: integer
unsafeMigrationOverride:
description: UnsafeMigrationOverride allows live migrations to occur even if the compatibility check indicates the migration will be unsafe to the guest. Defaults to false
type: boolean
type: object
migrationPolicyName:
description: Name of the migration policy. If string is empty, no policy is matched
type: string
migrationUid:
description: The VirtualMachineInstanceMigration object associated with this migration
type: string
mode:
description: Lets us know if the vmi is currently running pre or post copy migration
type: string
sourceNode:
description: The source node that the VMI originated on
type: string
startTimestamp:
description: The time the migration action began
format: date-time
nullable: true
type: string
targetAttachmentPodUID:
description: The UID of the target attachment pod for hotplug volumes
type: string
targetCPUSet:
description: If the VMI requires dedicated CPUs, this field will hold the dedicated CPU set on the target node
items:
type: integer
type: array
x-kubernetes-list-type: atomic
targetDirectMigrationNodePorts:
additionalProperties:
type: integer
description: The list of ports opened for live migration on the destination node
type: object
targetNode:
description: The target node that the VMI is moving to
type: string
targetNodeAddress:
description: The address of the target node to use for the migration
type: string
targetNodeDomainDetected:
description: The Target Node has seen the Domain Start Event
type: boolean
targetNodeDomainReadyTimestamp:
description: The timestamp at which the target node detects the domain is active
format: date-time
type: string
targetNodeTopology:
description: If the VMI requires dedicated CPUs, this field will hold the numa topology on the target node
type: string
targetPod:
description: The target pod that the VMI is moving to
type: string
type: object
phase:
description: VirtualMachineInstanceMigrationPhase is a label for the condition of a VirtualMachineInstanceMigration at the current time.
type: string
phaseTransitionTimestamps:
description: PhaseTransitionTimestamp is the timestamp of when the last phase change occurred
items:
description: VirtualMachineInstanceMigrationPhaseTransitionTimestamp gives a timestamp in relation to when a phase is set on a vmi
properties:
phase:
description: Phase is the status of the VirtualMachineInstanceMigrationPhase in kubernetes world. It is not the VirtualMachineInstanceMigrationPhase status, but partially correlates to it.
type: string
phaseTransitionTimestamp:
description: PhaseTransitionTimestamp is the timestamp of when the phase change occurred
format: date-time
type: string
type: object
type: array
x-kubernetes-list-type: atomic
type: object
required:
- spec
type: object
served: true
storage: false
subresources:
status: {}

View File

@@ -0,0 +1,495 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
kubevirt.io/generation: "1"
kubevirt.io/install-strategy-identifier: c51bc47ef3eccba54f764552d24801eb8388b36e
kubevirt.io/install-strategy-registry: quay.io/kubevirt
kubevirt.io/install-strategy-version: v1.0.1
generation: 1
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: virtualmachineinstancetypes.instancetype.kubevirt.io
spec:
conversion:
strategy: None
group: instancetype.kubevirt.io
names:
categories:
- all
kind: VirtualMachineInstancetype
listKind: VirtualMachineInstancetypeList
plural: virtualmachineinstancetypes
shortNames:
- vminstancetype
- vminstancetypes
- vmf
- vmfs
singular: virtualmachineinstancetype
scope: Namespaced
versions:
- deprecated: true
deprecationWarning: instancetype.kubevirt.io/v1alpha1 VirtualMachineInstancetypes is now deprecated and will be removed in v1.
name: v1alpha1
schema:
openAPIV3Schema:
description: VirtualMachineInstancetype resource contains quantitative and resource related VirtualMachine configuration that can be used by multiple VirtualMachine resources.
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: Required spec describing the instancetype
properties:
cpu:
description: Required CPU related attributes of the instancetype.
properties:
dedicatedCPUPlacement:
description: DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.
type: boolean
guest:
description: "Required number of vCPUs to expose to the guest. \n The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets."
format: int32
type: integer
isolateEmulatorThread:
description: IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.
type: boolean
model:
description: Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like "host-passthrough" to get the same CPU as the node and "host-model" to get CPU closest to the node one. Defaults to host-model.
type: string
numa:
description: NUMA allows specifying settings for the guest NUMA topology
properties:
guestMappingPassthrough:
description: GuestMappingPassthrough will create an efficient guest topology based on host CPUs exclusively assigned to a pod. The created topology ensures that memory and CPUs on the virtual numa nodes never cross boundaries of host numa nodes.
type: object
type: object
realtime:
description: Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads
properties:
mask:
description: 'Mask defines the vcpu mask expression that defines which vcpus are used for realtime. Format matches libvirt''s expressions. Example: "0-3,^1","0,2,3","2-3"'
type: string
type: object
required:
- guest
type: object
gpus:
description: Optionally defines any GPU devices associated with the instancetype.
items:
properties:
deviceName:
type: string
name:
description: Name of the GPU device as exposed by a device plugin
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
virtualGPUOptions:
properties:
display:
properties:
enabled:
description: Enabled determines if a display addapter backed by a vGPU should be enabled or disabled on the guest. Defaults to true.
type: boolean
ramFB:
description: Enables a boot framebuffer, until the guest OS loads a real GPU driver Defaults to true.
properties:
enabled:
description: Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.
type: boolean
type: object
type: object
type: object
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
hostDevices:
description: Optionally defines any HostDevices associated with the instancetype.
items:
properties:
deviceName:
description: DeviceName is the resource name of the host device exposed by a device plugin
type: string
name:
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
ioThreadsPolicy:
description: Optionally defines the IOThreadsPolicy to be used by the instancetype.
type: string
launchSecurity:
description: Optionally defines the LaunchSecurity to be used by the instancetype.
properties:
sev:
description: AMD Secure Encrypted Virtualization (SEV).
properties:
policy:
description: 'Guest policy flags as defined in AMD SEV API specification. Note: due to security reasons it is not allowed to enable guest debugging. Therefore NoDebug flag is not exposed to users and is always true.'
properties:
encryptedState:
description: SEV-ES is required. Defaults to false.
type: boolean
type: object
type: object
type: object
memory:
description: Required Memory related attributes of the instancetype.
properties:
guest:
anyOf:
- type: integer
- type: string
description: Required amount of memory which is visible inside the guest OS.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
hugepages:
description: Optionally enables the use of hugepages for the VirtualMachineInstance instead of regular memory.
properties:
pageSize:
description: PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.
type: string
type: object
overcommitPercent:
description: OvercommitPercent is the percentage of the guest memory which will be overcommitted. This means that the VMIs parent pod (virt-launcher) will request less physical memory by a factor specified by the OvercommitPercent. Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 0
maximum: 100
minimum: 0
type: integer
required:
- guest
type: object
required:
- cpu
- memory
type: object
required:
- spec
type: object
served: true
storage: false
- deprecated: true
deprecationWarning: instancetype.kubevirt.io/v1alpha2 VirtualMachineInstancetypes is now deprecated and will be removed in v1.
name: v1alpha2
schema:
openAPIV3Schema:
description: VirtualMachineInstancetype resource contains quantitative and resource related VirtualMachine configuration that can be used by multiple VirtualMachine resources.
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: Required spec describing the instancetype
properties:
cpu:
description: Required CPU related attributes of the instancetype.
properties:
dedicatedCPUPlacement:
description: DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.
type: boolean
guest:
description: "Required number of vCPUs to expose to the guest. \n The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets."
format: int32
type: integer
isolateEmulatorThread:
description: IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.
type: boolean
model:
description: Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like "host-passthrough" to get the same CPU as the node and "host-model" to get CPU closest to the node one. Defaults to host-model.
type: string
numa:
description: NUMA allows specifying settings for the guest NUMA topology
properties:
guestMappingPassthrough:
description: GuestMappingPassthrough will create an efficient guest topology based on host CPUs exclusively assigned to a pod. The created topology ensures that memory and CPUs on the virtual numa nodes never cross boundaries of host numa nodes.
type: object
type: object
realtime:
description: Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads
properties:
mask:
description: 'Mask defines the vcpu mask expression that defines which vcpus are used for realtime. Format matches libvirt''s expressions. Example: "0-3,^1","0,2,3","2-3"'
type: string
type: object
required:
- guest
type: object
gpus:
description: Optionally defines any GPU devices associated with the instancetype.
items:
properties:
deviceName:
type: string
name:
description: Name of the GPU device as exposed by a device plugin
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
virtualGPUOptions:
properties:
display:
properties:
enabled:
description: Enabled determines if a display addapter backed by a vGPU should be enabled or disabled on the guest. Defaults to true.
type: boolean
ramFB:
description: Enables a boot framebuffer, until the guest OS loads a real GPU driver Defaults to true.
properties:
enabled:
description: Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.
type: boolean
type: object
type: object
type: object
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
hostDevices:
description: Optionally defines any HostDevices associated with the instancetype.
items:
properties:
deviceName:
description: DeviceName is the resource name of the host device exposed by a device plugin
type: string
name:
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
ioThreadsPolicy:
description: Optionally defines the IOThreadsPolicy to be used by the instancetype.
type: string
launchSecurity:
description: Optionally defines the LaunchSecurity to be used by the instancetype.
properties:
sev:
description: AMD Secure Encrypted Virtualization (SEV).
properties:
policy:
description: 'Guest policy flags as defined in AMD SEV API specification. Note: due to security reasons it is not allowed to enable guest debugging. Therefore NoDebug flag is not exposed to users and is always true.'
properties:
encryptedState:
description: SEV-ES is required. Defaults to false.
type: boolean
type: object
type: object
type: object
memory:
description: Required Memory related attributes of the instancetype.
properties:
guest:
anyOf:
- type: integer
- type: string
description: Required amount of memory which is visible inside the guest OS.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
hugepages:
description: Optionally enables the use of hugepages for the VirtualMachineInstance instead of regular memory.
properties:
pageSize:
description: PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.
type: string
type: object
overcommitPercent:
description: OvercommitPercent is the percentage of the guest memory which will be overcommitted. This means that the VMIs parent pod (virt-launcher) will request less physical memory by a factor specified by the OvercommitPercent. Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 0
maximum: 100
minimum: 0
type: integer
required:
- guest
type: object
required:
- cpu
- memory
type: object
required:
- spec
type: object
served: true
storage: false
- name: v1beta1
schema:
openAPIV3Schema:
description: VirtualMachineInstancetype resource contains quantitative and resource related VirtualMachine configuration that can be used by multiple VirtualMachine resources.
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: Required spec describing the instancetype
properties:
cpu:
description: Required CPU related attributes of the instancetype.
properties:
dedicatedCPUPlacement:
description: DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.
type: boolean
guest:
description: "Required number of vCPUs to expose to the guest. \n The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets."
format: int32
type: integer
isolateEmulatorThread:
description: IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.
type: boolean
model:
description: Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like "host-passthrough" to get the same CPU as the node and "host-model" to get CPU closest to the node one. Defaults to host-model.
type: string
numa:
description: NUMA allows specifying settings for the guest NUMA topology
properties:
guestMappingPassthrough:
description: GuestMappingPassthrough will create an efficient guest topology based on host CPUs exclusively assigned to a pod. The created topology ensures that memory and CPUs on the virtual numa nodes never cross boundaries of host numa nodes.
type: object
type: object
realtime:
description: Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads
properties:
mask:
description: 'Mask defines the vcpu mask expression that defines which vcpus are used for realtime. Format matches libvirt''s expressions. Example: "0-3,^1","0,2,3","2-3"'
type: string
type: object
required:
- guest
type: object
gpus:
description: Optionally defines any GPU devices associated with the instancetype.
items:
properties:
deviceName:
type: string
name:
description: Name of the GPU device as exposed by a device plugin
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
virtualGPUOptions:
properties:
display:
properties:
enabled:
description: Enabled determines if a display addapter backed by a vGPU should be enabled or disabled on the guest. Defaults to true.
type: boolean
ramFB:
description: Enables a boot framebuffer, until the guest OS loads a real GPU driver Defaults to true.
properties:
enabled:
description: Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.
type: boolean
type: object
type: object
type: object
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
hostDevices:
description: Optionally defines any HostDevices associated with the instancetype.
items:
properties:
deviceName:
description: DeviceName is the resource name of the host device exposed by a device plugin
type: string
name:
type: string
tag:
description: If specified, the virtual network interface address and its tag will be provided to the guest via config drive
type: string
required:
- deviceName
- name
type: object
type: array
x-kubernetes-list-type: atomic
ioThreadsPolicy:
description: Optionally defines the IOThreadsPolicy to be used by the instancetype.
type: string
launchSecurity:
description: Optionally defines the LaunchSecurity to be used by the instancetype.
properties:
sev:
description: AMD Secure Encrypted Virtualization (SEV).
properties:
policy:
description: 'Guest policy flags as defined in AMD SEV API specification. Note: due to security reasons it is not allowed to enable guest debugging. Therefore NoDebug flag is not exposed to users and is always true.'
properties:
encryptedState:
description: SEV-ES is required. Defaults to false.
type: boolean
type: object
type: object
type: object
memory:
description: Required Memory related attributes of the instancetype.
properties:
guest:
anyOf:
- type: integer
- type: string
description: Required amount of memory which is visible inside the guest OS.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
hugepages:
description: Optionally enables the use of hugepages for the VirtualMachineInstance instead of regular memory.
properties:
pageSize:
description: PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.
type: string
type: object
overcommitPercent:
description: OvercommitPercent is the percentage of the guest memory which will be overcommitted. This means that the VMIs parent pod (virt-launcher) will request less physical memory by a factor specified by the OvercommitPercent. Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 0
maximum: 100
minimum: 0
type: integer
required:
- guest
type: object
required:
- cpu
- memory
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -0,0 +1,152 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
kubevirt.io/generation: "1"
kubevirt.io/install-strategy-identifier: c51bc47ef3eccba54f764552d24801eb8388b36e
kubevirt.io/install-strategy-registry: quay.io/kubevirt
kubevirt.io/install-strategy-version: v1.0.1
generation: 1
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: virtualmachinerestores.snapshot.kubevirt.io
spec:
conversion:
strategy: None
group: snapshot.kubevirt.io
names:
categories:
- all
kind: VirtualMachineRestore
listKind: VirtualMachineRestoreList
plural: virtualmachinerestores
shortNames:
- vmrestore
- vmrestores
singular: virtualmachinerestore
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.target.kind
name: TargetKind
type: string
- jsonPath: .spec.target.name
name: TargetName
type: string
- jsonPath: .status.complete
name: Complete
type: boolean
- jsonPath: .status.restoreTime
name: RestoreTime
type: date
- jsonPath: .status.error.message
name: Error
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: VirtualMachineRestore defines the operation of restoring a VM
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: VirtualMachineRestoreSpec is the spec for a VirtualMachineRestoreresource
properties:
patches:
description: "If the target for the restore does not exist, it will be created. Patches holds JSON patches that would be applied to the target manifest before it's created. Patches should fit the target's Kind. \n Example for a patch: {\"op\": \"replace\", \"path\": \"/metadata/name\", \"value\": \"new-vm-name\"}"
items:
type: string
type: array
x-kubernetes-list-type: atomic
target:
description: initially only VirtualMachine type supported
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
virtualMachineSnapshotName:
type: string
required:
- target
- virtualMachineSnapshotName
type: object
status:
description: VirtualMachineRestoreStatus is the spec for a VirtualMachineRestoreresource
properties:
complete:
type: boolean
conditions:
items:
description: Condition defines conditions
properties:
lastProbeTime:
format: date-time
nullable: true
type: string
lastTransitionTime:
format: date-time
nullable: true
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
description: ConditionType is the const type for Conditions
type: string
required:
- status
- type
type: object
type: array
deletedDataVolumes:
items:
type: string
type: array
restoreTime:
format: date-time
type: string
restores:
items:
description: VolumeRestore contains the data neeed to restore a PVC
properties:
dataVolumeName:
type: string
persistentVolumeClaim:
type: string
volumeName:
type: string
volumeSnapshotName:
type: string
required:
- persistentVolumeClaim
- volumeName
- volumeSnapshotName
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -0,0 +1,168 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
kubevirt.io/generation: "1"
kubevirt.io/install-strategy-identifier: c51bc47ef3eccba54f764552d24801eb8388b36e
kubevirt.io/install-strategy-registry: quay.io/kubevirt
kubevirt.io/install-strategy-version: v1.0.1
generation: 1
labels:
app.kubernetes.io/component: kubevirt
app.kubernetes.io/managed-by: virt-operator
kubevirt.io: ""
name: virtualmachinesnapshots.snapshot.kubevirt.io
spec:
conversion:
strategy: None
group: snapshot.kubevirt.io
names:
categories:
- all
kind: VirtualMachineSnapshot
listKind: VirtualMachineSnapshotList
plural: virtualmachinesnapshots
shortNames:
- vmsnapshot
- vmsnapshots
singular: virtualmachinesnapshot
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.source.kind
name: SourceKind
type: string
- jsonPath: .spec.source.name
name: SourceName
type: string
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .status.readyToUse
name: ReadyToUse
type: boolean
- jsonPath: .status.creationTime
name: CreationTime
type: date
- jsonPath: .status.error.message
name: Error
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: VirtualMachineSnapshot defines the operation of snapshotting a VM
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
metadata:
type: object
spec:
description: VirtualMachineSnapshotSpec is the spec for a VirtualMachineSnapshot resource
properties:
deletionPolicy:
description: DeletionPolicy defines that to do with VirtualMachineSnapshot when VirtualMachineSnapshot is deleted
type: string
failureDeadline:
description: This time represents the number of seconds we permit the vm snapshot to take. In case we pass this deadline we mark this snapshot as failed. Defaults to DefaultFailureDeadline - 5min
type: string
source:
description: TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
required:
- source
type: object
status:
description: VirtualMachineSnapshotStatus is the status for a VirtualMachineSnapshot resource
properties:
conditions:
items:
description: Condition defines conditions
properties:
lastProbeTime:
format: date-time
nullable: true
type: string
lastTransitionTime:
format: date-time
nullable: true
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
description: ConditionType is the const type for Conditions
type: string
required:
- status
- type
type: object
type: array
creationTime:
format: date-time
nullable: true
type: string
error:
description: Error is the last error encountered during the snapshot/restore
properties:
message:
type: string
time:
format: date-time
type: string
type: object
indications:
items:
description: Indication is a way to indicate the state of the vm when taking the snapshot
type: string
type: array
x-kubernetes-list-type: set
phase:
description: VirtualMachineSnapshotPhase is the current phase of the VirtualMachineSnapshot
type: string
readyToUse:
type: boolean
snapshotVolumes:
description: SnapshotVolumesLists includes the list of volumes which were included in the snapshot and volumes which were excluded from the snapshot
properties:
excludedVolumes:
items:
type: string
type: array
x-kubernetes-list-type: set
includedVolumes:
items:
type: string
type: array
x-kubernetes-list-type: set
type: object
sourceUID:
description: UID is a type that holds unique ID values, including UUIDs. Because we don't ONLY use UUIDs, this is an alias to string. Being a type captures intent and helps make sure that UIDs and names do not get conflated.
type: string
virtualMachineSnapshotContentName:
type: string
type: object
required:
- spec
type: object
served: true
storage: true

17
crd/kubevirt/datas.tf Normal file
View File

@@ -0,0 +1,17 @@
locals {
common-labels = {
"vynil.solidite.fr/owner-name" = var.instance
"vynil.solidite.fr/owner-namespace" = var.namespace
"vynil.solidite.fr/owner-category" = var.category
"vynil.solidite.fr/owner-component" = var.component
"app.kubernetes.io/managed-by" = "vynil"
"app.kubernetes.io/name" = var.component
"app.kubernetes.io/instance" = var.instance
}
}
data "kustomization_overlay" "data" {
common_labels = local.common-labels
namespace = var.namespace
resources = []
}

40
crd/kubevirt/index.rhai Normal file
View File

@@ -0,0 +1,40 @@
const VERSION="3.5.5";
const SRC=src;
const DEST=dest;
const DOIT=config.apply;
const PURGE=config.purge;
const crdFiles=[
"apiextensions.k8s.io_v1_CustomResourceDefinition_kubevirts.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_migrationpolicies.migrations.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineclones.clone.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineclusterinstancetypes.instancetype.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineclusterpreferences.instancetype.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineexports.export.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineinstancemigrations.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineinstancepresets.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineinstancereplicasets.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineinstances.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachineinstancetypes.instancetype.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachinepools.pool.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachinepreferences.instancetype.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachinerestores.snapshot.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachines.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachinesnapshotcontents.snapshot.kubevirt.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_virtualmachinesnapshots.snapshot.kubevirt.io.yaml",
];
fn pre_install() {
if ! global::DOIT {
return;
}
for file in global::crdFiles {
shell(`kubectl replace -f ${global::SRC}/${file} || kubectl create -f ${global::SRC}/${file}`);
}
}
fn post_destroy() {
if ! global::PURGE {
return;
}
for file in global::crdFiles {
shell(`kubectl delete -f ${global::SRC}/${file}`);
}
}

21
crd/kubevirt/index.yaml Normal file
View File

@@ -0,0 +1,21 @@
---
apiVersion: vinyl.solidite.fr/v1beta1
kind: Component
category: crd
metadata:
name: kubevirt
description: CRD for kube-virt
options:
apply:
default: true
examples:
- true
type: boolean
purge:
default: false
examples:
- false
type: boolean
dependencies: []
providers: null
tfaddtype: null