Skip to content

Commit

Permalink
flavors: Add examples
Browse files Browse the repository at this point in the history
This change adds the following flavor and preference examples:

- Small compute flavor (Both namespaced and cluster wide)
- Large compute flavor
- Virtio preferences
- Windows preferences

Variouis example VM definitions are also included.

Signed-off-by: Lee Yarwood <[email protected]>
  • Loading branch information
lyarwood committed May 22, 2022
1 parent f8de147 commit 5342928
Show file tree
Hide file tree
Showing 16 changed files with 595 additions and 38 deletions.
39 changes: 39 additions & 0 deletions examples/vm-cirros-clarge-virtio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: vm-cirros-clarge-virtio
name: vm-cirros-clarge-virtio
spec:
flavor:
kind: VirtualMachineFlavor
name: vmf-clarge
preference:
kind: VirtualMachinePreference
name: vmpvirtio
running: false
template:
metadata:
labels:
kubevirt.io/vm: vm-cirros-clarge-virtio
spec:
domain:
devices:
disks:
- disk: {}
name: containerdisk
- disk: {}
name: cloudinitdisk
resources: {}
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/cirros-container-disk-demo:devel
name: containerdisk
- cloudInitNoCloud:
userData: |
#!/bin/sh
echo 'printed from cloud-init userdata'
name: cloudinitdisk
39 changes: 39 additions & 0 deletions examples/vm-cirros-clarge-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: vm-cirros-clarge-windows
name: vm-cirros-clarge-windows
spec:
flavor:
kind: VirtualMachineFlavor
name: vmf-clarge
preference:
kind: VirtualMachinePreference
name: vmpwindows
running: false
template:
metadata:
labels:
kubevirt.io/vm: vm-cirros-clarge-windows
spec:
domain:
devices:
disks:
- disk: {}
name: containerdisk
- disk: {}
name: cloudinitdisk
resources: {}
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/cirros-container-disk-demo:devel
name: containerdisk
- cloudInitNoCloud:
userData: |
#!/bin/sh
echo 'printed from cloud-init userdata'
name: cloudinitdisk
37 changes: 37 additions & 0 deletions examples/vm-cirros-clarge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: vm-cirros-clarge
name: vm-cirros-clarge
spec:
flavor:
kind: VirtualMachineFlavor
name: vmf-clarge
running: false
template:
metadata:
labels:
kubevirt.io/vm: vm-cirros-clarge
spec:
domain:
devices:
disks:
- disk: {}
name: containerdisk
- disk:
bus: virtio
name: cloudinitdisk
resources: {}
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/cirros-container-disk-demo:devel
name: containerdisk
- cloudInitNoCloud:
userData: |
#!/bin/sh
echo 'printed from cloud-init userdata'
name: cloudinitdisk
37 changes: 37 additions & 0 deletions examples/vm-cirros-csmall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: vm-cirros-csmall
name: vm-cirros-csmall
spec:
flavor:
kind: VirtualMachineFlavor
name: vmf-csmall
running: false
template:
metadata:
labels:
kubevirt.io/vm: vm-cirros-csmall
spec:
domain:
devices:
disks:
- disk: {}
name: containerdisk
- disk:
bus: virtio
name: cloudinitdisk
resources: {}
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/cirros-container-disk-demo:devel
name: containerdisk
- cloudInitNoCloud:
userData: |
#!/bin/sh
echo 'printed from cloud-init userdata'
name: cloudinitdisk
37 changes: 37 additions & 0 deletions examples/vm-cirros-vmcf-csmall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: vm-cirros-csmall
name: vm-cirros-csmall
spec:
flavor:
kind: VirtualMachineClusterFlavor
name: vmf-csmall
running: false
template:
metadata:
labels:
kubevirt.io/vm: vm-cirros-csmall
spec:
domain:
devices:
disks:
- disk: {}
name: containerdisk
- disk:
bus: virtio
name: cloudinitdisk
resources: {}
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/cirros-container-disk-demo:devel
name: containerdisk
- cloudInitNoCloud:
userData: |
#!/bin/sh
echo 'printed from cloud-init userdata'
name: cloudinitdisk
33 changes: 33 additions & 0 deletions examples/vm-windows-clarge-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: vm-windows-clarge-windows
name: vm-windows-clarge-windows
spec:
flavor:
kind: VirtualMachineFlavor
name: vmf-clarge
preference:
kind: VirtualMachinePreference
name: vmpwindows
running: false
template:
metadata:
labels:
kubevirt.io/vm: vm-windows-clarge-windows
spec:
domain:
devices:
disks:
- disk: {}
name: pvcdisk
firmware:
uuid: 5d307ca9-b3ef-428c-8861-06e72d69f223
resources: {}
terminationGracePeriodSeconds: 0
volumes:
- name: pvcdisk
persistentVolumeClaim:
claimName: disk-windows
10 changes: 10 additions & 0 deletions examples/vmcf-csmall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: flavor.kubevirt.io/v1alpha1
kind: VirtualMachineClusterFlavor
metadata:
name: vmcf-csmall
spec:
cpu:
guest: 1
memory:
guest: 128Mi
10 changes: 10 additions & 0 deletions examples/vmf-clarge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: flavor.kubevirt.io/v1alpha1
kind: VirtualMachineFlavor
metadata:
name: vmf-clarge
spec:
cpu:
guest: 4
memory:
guest: 2Gi
10 changes: 10 additions & 0 deletions examples/vmf-csmall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: flavor.kubevirt.io/v1alpha1
kind: VirtualMachineFlavor
metadata:
name: vmf-csmall
spec:
cpu:
guest: 1
memory:
guest: 128Mi
22 changes: 0 additions & 22 deletions examples/vmi-flavor-small.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions examples/vmpvirtio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: flavor.kubevirt.io/v1alpha1
kind: VirtualMachinePreference
metadata:
name: vmpvirtio
spec:
devices:
preferredDiskBus: virtio
preferredInterfaceModel: virtio
35 changes: 35 additions & 0 deletions examples/vmpwindows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
apiVersion: flavor.kubevirt.io/v1alpha1
kind: VirtualMachinePreference
metadata:
name: vmpwindows
spec:
clock:
preferredClockOffset:
utc: {}
preferredTimer:
hpet:
present: false
hyperv: {}
pit:
tickPolicy: delay
rtc:
tickPolicy: catchup
cpu:
preferredCPUTopology: preferSockets
devices:
preferredDiskBus: sata
preferredInterfaceModel: e1000
preferredTPM: {}
features:
preferredAcpi: {}
preferredApic: {}
preferredHyperv:
relaxed: {}
spinlocks:
spinlocks: 8191
vapic: {}
preferredSmm: {}
firmware:
preferredUseEfi: true
preferredUseSecureBoot: true
1 change: 1 addition & 0 deletions tools/vms-generator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ go_library(
"//pkg/testutils:go_default_library",
"//pkg/virt-api/webhooks/validating-webhook/admitters:go_default_library",
"//staging/src/kubevirt.io/api/core/v1:go_default_library",
"//staging/src/kubevirt.io/api/flavor/v1alpha1:go_default_library",
"//staging/src/kubevirt.io/api/pool/v1alpha1:go_default_library",
"//tools/util:go_default_library",
"//tools/vms-generator/utils:go_default_library",
Expand Down
2 changes: 2 additions & 0 deletions tools/vms-generator/utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//staging/src/kubevirt.io/api/core/v1:go_default_library",
"//staging/src/kubevirt.io/api/flavor/v1alpha1:go_default_library",
"//staging/src/kubevirt.io/api/pool/v1alpha1:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/scheduling/v1:go_default_library",
Expand All @@ -18,6 +19,7 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/utils/pointer:go_default_library",
"//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1:go_default_library",
],
)
Loading

0 comments on commit 5342928

Please sign in to comment.