Skip to content

Commit 813862a

Browse files
committed
docs: add crd examples
Signed-off-by: Vladislav Panfilov <vladislav.panfilov@flant.com>
1 parent 79ad6ba commit 813862a

13 files changed

Lines changed: 123 additions & 0 deletions

crds/clustervirtualimages.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ spec:
5858
With this resource in the cluster, a container image is created and stored in a dedicated Deckhouse Virtualization Container Registry (DVCR).
5959
6060
**Note:** The `metadata.name` field must comply with [Kubernetes object naming conventions](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/) and must not exceed 48 characters.
61+
x-examples:
62+
- apiVersion: virtualization.deckhouse.io/v1alpha2
63+
kind: ClusterVirtualImage
64+
metadata:
65+
name: ubuntu-24-04
66+
spec:
67+
dataSource:
68+
type: HTTP
69+
http:
70+
url: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
6171
properties:
6272
apiVersion:
6373
description: |-

crds/nodeusbdevices.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ spec:
4747
Represents a USB device discovered on a specific node in the cluster.
4848
This resource is created automatically by the DRA (Dynamic Resource Allocation) system
4949
when a USB device is detected on a node.
50+
x-examples:
51+
- apiVersion: virtualization.deckhouse.io/v1alpha2
52+
kind: NodeUSBDevice
53+
metadata:
54+
name: logitech-webcam
55+
spec:
56+
assignedNamespace: my-project
5057
properties:
5158
apiVersion:
5259
description: |-

crds/virtualdisks.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ spec:
6060
Once a VirtualDisk is created, the following fields in `.spec.persistentVolumeClaim` can be changed: `size` and `storageClassName`. All other fields are immutable.
6161
6262
**Note:** The `metadata.name` field must comply with [Kubernetes object naming conventions](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/) and must not exceed 60 characters.
63+
x-examples:
64+
- apiVersion: virtualization.deckhouse.io/v1alpha2
65+
kind: VirtualDisk
66+
metadata:
67+
name: blank-disk
68+
spec:
69+
persistentVolumeClaim:
70+
storageClassName: rv-thin-r2
71+
size: 100Mi
6372
properties:
6473
apiVersion:
6574
description: |-

crds/virtualdisksnapshots.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ spec:
2929
Provides a resource for creating snapshots of existing virtual disks, which can be used as data sources for generating new virtual disks.
3030
3131
When running, a VolumeSnapshot resource is created.
32+
x-examples:
33+
- apiVersion: virtualization.deckhouse.io/v1alpha2
34+
kind: VirtualDiskSnapshot
35+
metadata:
36+
name: linux-vm-root-snapshot
37+
spec:
38+
requiredConsistency: true
39+
virtualDiskName: linux-vm-root
3240
required:
3341
- spec
3442
properties:

crds/virtualimages.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ spec:
6161
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.
6262
6363
**Note:** The `metadata.name` field must comply with [Kubernetes object naming conventions](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/) and must not exceed 49 characters.
64+
x-examples:
65+
- apiVersion: virtualization.deckhouse.io/v1alpha2
66+
kind: VirtualImage
67+
metadata:
68+
name: ubuntu-24-04
69+
spec:
70+
storage: ContainerRegistry
71+
dataSource:
72+
type: HTTP
73+
http:
74+
url: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
6475
properties:
6576
apiVersion:
6677
description: |-

crds/virtualmachineblockdeviceattachments.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ spec:
5050
description: |-
5151
VirtualMachineBlockDeviceAttachment provides a hot plug for attaching a disk to a virtual machine.
5252
Disks are always attached using the SCSI bus, regardless of the enableParavirtualization setting.
53+
x-examples:
54+
- apiVersion: virtualization.deckhouse.io/v1alpha2
55+
kind: VirtualMachineBlockDeviceAttachment
56+
metadata:
57+
name: attach-blank-disk
58+
spec:
59+
blockDeviceRef:
60+
kind: VirtualDisk
61+
name: blank-disk
62+
virtualMachineName: linux-vm
5363
properties:
5464
apiVersion:
5565
description: |-

crds/virtualmachineclasses.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ spec:
4444
description: |-
4545
VirtualMachineClass resource describes CPU requirements, node placement, and sizing policy for VM resources.
4646
A resource cannot be deleted as long as it is used in one of the VMs.
47+
x-examples:
48+
- apiVersion: virtualization.deckhouse.io/v1alpha2
49+
kind: VirtualMachineClass
50+
metadata:
51+
name: host
52+
spec:
53+
cpu:
54+
type: Host
4755
properties:
4856
apiVersion:
4957
description: |-

crds/virtualmachineipaddresses.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ spec:
2222
openAPIV3Schema:
2323
description: |
2424
Defines the IP address for a virtual machine.
25+
x-examples:
26+
- apiVersion: virtualization.deckhouse.io/v1alpha2
27+
kind: VirtualMachineIPAddress
28+
metadata:
29+
name: linux-vm-custom-ip
30+
spec:
31+
type: Static
32+
staticIP: 10.66.20.77
2533
properties:
2634
apiVersion:
2735
type: string

crds/virtualmachineoperations.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ spec:
4848
description:
4949
VirtualMachineOperation enables declarative management of virtual
5050
machine state changes.
51+
x-examples:
52+
- apiVersion: virtualization.deckhouse.io/v1alpha2
53+
kind: VirtualMachineOperation
54+
metadata:
55+
generateName: restart-linux-vm-
56+
spec:
57+
virtualMachineName: linux-vm
58+
type: Restart
5159
properties:
5260
apiVersion:
5361
description: |-

crds/virtualmachinerestores.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ spec:
4040
description:
4141
VirtualMachineRestore provides a resource for restoring a virtual
4242
machine and all associated resources from a snapshot.
43+
x-examples:
44+
- apiVersion: virtualization.deckhouse.io/v1alpha2
45+
kind: VirtualMachineRestore
46+
metadata:
47+
name: restore-linux-vm
48+
spec:
49+
virtualMachineSnapshotName: linux-vm-snapshot
4350
properties:
4451
apiVersion:
4552
description: |-

0 commit comments

Comments
 (0)