Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add Name suffix #100

Closed
wants to merge 13 commits into from
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ It offers the following features:

- A simple and intuitive interface for declarative creation and management of virtual machines and their resources.
- The ability to run legacy applications that for some reason cannot or are difficult to run in a container.
- Ability to run applications that require non-Linux operating systems.
- Ability to run virtual machines and containerized applications in the same environment.
- Integration with the existing Deckhouse ecosystem to leverage its capabilities for virtual machines.

Expand All @@ -20,24 +21,37 @@ It offers the following features:
The following conditions are required to run the module:

- A processor with x86_64 architecture and support for Intel-VT or AMD-V instructions.
- Cluster resource requirements and configuration specifics are available for reading on [this](https://deckhouse.io/guides/production.html) page.
- Any [compatible](https://deckhouse.io/documentation/v1/supported_versions.html#linux) Linux-based OS is supported for installation.
- The Linux kernel on the cluster nodes must be version 5.7 or newer.
- The [CNI Cilium](https://deckhouse.ru/documentation/v1/modules/021-cni-cilium/) module to provide network connectivity for virtual machines.
- Modules SDS-DRBD or [Ceph](https://deckhouse.ru/documentation/v1/modules/031-ceph-csi/) for storing virtual machine data. It is also possible to use other storage options that support the creation of block devices with `RWX` (`ReadWriteMany`) access mode.
- The [CNI Cilium](/documentation/v1/modules/021-cni-cilium/) module to provide network connectivity for virtual machines.
- Modules [SDS-DRBD](https://deckhouse.io/modules/sds-drbd/stable/) or [CEPH-CSI](/documentation/v1/modules/031-ceph-csi/) for storing virtual machine data. It is also possible to use other storage options that support the creation of block devices with `RWX` (`ReadWriteMany`) access mode.

The command line utility [d8](https://github.com/deckhouse/deckhouse-cli) is used to create cluster resources and connect to virtual machines. For users of the EE-version the ability to manage resources via UI is available.

## What do I need to enable the module?

Procedure for enabling the module

1. Configure the deckhouse cluster
2. Enable the [CNI Cilium](/documentation/v1/modules/021-cni-cilium/) module
3. Install and configure SDS-DRBD/CEPH/etc storage
4. Enable the virtualization module

## Architecture

The module includes the following components:

- The module core, based on the KubeVirt project and uses QEMU/KVM + libvirtd to run virtual machines.
- Deckhouse Virtualization Container Registry (DVCR) - repository for storing and caching virtual machine images.
- Virtualization-controller - API for creating and managing virtual machine resources.
- Virtualization-API - controller that implements a user API for creating and managing virtual machine resources.

The API provides capabilities for creating and managing the following resources:

- Images
- Disks
- Virtual Images
- Virtual Disks
- Virtual machines
- Operations
- Virtual Machine Operations

## How to enable module

Expand All @@ -57,8 +71,8 @@ spec:
size: 50G # size of DVCR storage
type: PersistentVolumeClaim
virtualMachineCIDRs:
- 10.66.10.0/24
- 10.66.20.0/24
- 10.66.30.0/24
- 10.66.10.0/24
- 10.66.20.0/24
- 10.66.30.0/24
version: 1
```
4 changes: 2 additions & 2 deletions api/core/v1alpha2/virtual_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ type VirtualDiskDownloadSpeed struct {
}

type DiskTarget struct {
PersistentVolumeClaim string `json:"persistentVolumeClaim"`
PersistentVolumeClaim string `json:"persistentVolumeClaimName"`
}

type VirtualDiskPersistentVolumeClaim struct {
StorageClass *string `json:"storageClass,omitempty"`
StorageClass *string `json:"storageClassName,omitempty"`
Size *resource.Quantity `json:"size,omitempty"`
}

Expand Down
8 changes: 4 additions & 4 deletions api/core/v1alpha2/virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type VirtualMachineSpec struct {

// VirtualMachineIPAddressClaim specifies a name for the associated
// `VirtualMachineIPAddressClaim` resource. Defaults to `{vm name}`.
VirtualMachineIPAddressClaim string `json:"virtualMachineIPAddressClaim,omitempty"`
VirtualMachineIPAddressClaim string `json:"virtualMachineIPAddressClaimName,omitempty"`

// TopologySpreadConstraints specifies how to spread matching pods among the given topology.
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
Expand Down Expand Up @@ -91,7 +91,7 @@ const (
)

type CPUSpec struct {
VirtualMachineCPUModel string `json:"virtualMachineCPUModel"`
VirtualMachineCPUModel string `json:"virtualMachineCPUModelName"`
Cores int `json:"cores"`
CoreFraction string `json:"coreFraction"`
}
Expand Down Expand Up @@ -143,8 +143,8 @@ const (

type VirtualMachineStatus struct {
Phase MachinePhase `json:"phase"`
Node string `json:"node"`
VirtualMachineIPAddressClaim string `json:"virtualMachineIPAddressClaim"`
Node string `json:"nodeName"`
VirtualMachineIPAddressClaim string `json:"virtualMachineIPAddressClaimName"`
IPAddress string `json:"ipAddress"`
BlockDeviceRefs []BlockDeviceStatusRef `json:"blockDeviceRefs"`
GuestOSInfo virtv1.VirtualMachineInstanceGuestOSInfo `json:"guestOSInfo"`
Expand Down
2 changes: 1 addition & 1 deletion api/core/v1alpha2/virtual_machine_block_disk_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type VirtualMachineBlockDeviceAttachmentList struct {
}

type VirtualMachineBlockDeviceAttachmentSpec struct {
VirtualMachine string `json:"virtualMachine"`
VirtualMachine string `json:"virtualMachineName"`
BlockDeviceRef VMBDAObjectRef `json:"blockDeviceRef"`
}

Expand Down
6 changes: 3 additions & 3 deletions api/core/v1alpha2/virtual_machine_ip_address_claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type VirtualMachineIPAddressClaimList struct {
// VirtualMachineIPAddressClaimSpec is the desired state of `VirtualMachineIPAddressClaim`.
type VirtualMachineIPAddressClaimSpec struct {
// The issued `VirtualMachineIPAddressLease`, managed automatically.
VirtualMachineIPAddressLease string `json:"virtualMachineIPAddressLease"`
VirtualMachineIPAddressLease string `json:"virtualMachineIPAddressLeaseName"`
// The requested IP address. If omitted the next available IP address will be assigned.
Address string `json:"address"`
// Determines the behavior of VirtualMachineIPAddressLease upon VirtualMachineIPAddressClaim deletion.
Expand All @@ -36,11 +36,11 @@ type VirtualMachineIPAddressClaimSpec struct {
// VirtualMachineIPAddressClaimStatus is the observed state of `VirtualMachineIPAddressClaim`.
type VirtualMachineIPAddressClaimStatus struct {
// Represents the virtual machine that currently uses this IP address.
VirtualMachine string `json:"virtualMachine,omitempty"`
VirtualMachine string `json:"virtualMachineName,omitempty"`
// Assigned IP address.
Address string `json:"address,omitempty"`
// The issued `VirtualMachineIPAddressLease`, managed automatically.
Lease string `json:"virtualMachineIPAddressLease,omitempty"`
Lease string `json:"virtualMachineIPAddressLeaseName,omitempty"`
// Represents the current state of IP address claim.
Phase VirtualMachineIPAddressClaimPhase `json:"phase,omitempty"`
// Detailed description of the error.
Expand Down
2 changes: 1 addition & 1 deletion api/core/v1alpha2/virtual_machine_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type VirtualMachineOperation struct {

type VirtualMachineOperationSpec struct {
Type VMOPOperation `json:"type"`
VirtualMachine string `json:"virtualMachine"`
VirtualMachine string `json:"virtualMachineName"`
Force bool `json:"force,omitempty"`
}

Expand Down
34 changes: 17 additions & 17 deletions api/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions crds/clustervirtualimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ spec:
properties:
dataSource:
type: object
description: |
An origin of the image.
required:
- type
properties:
Expand Down Expand Up @@ -151,7 +153,8 @@ spec:
YWFhCg==
objectRef:
type: object
description: Reference to existing `VirtualImage` or `ClusterVirtualImage`.
description: |
Use an existing `VirtualImage` or `ClusterVirtualImage` to create an image.
required: ["kind", "name"]
properties:
kind:
Expand Down Expand Up @@ -293,10 +296,10 @@ spec:
type: string
description: |
Detailed description of the error. human-readable
usedInVMs:
attachedToVirtualMachines:
type: array
description: |
A list of virtual s and namespaces that use the image
A list of virtual machines and namespaces that use the image
example:
[
{ name: "VM100", namespace: "customer1" },
Expand Down
Loading