Skip to content

VirtRigaud Examples

This directory contains examples for VirtRigaud v0.3.8. All YAML examples use the infra.virtrigaud.io/v1beta1 API.

Quick Start Examples

Basic Examples

Provider Examples

Resource Examples

v0.3.8 Feature Examples

VMClone (MVP — vSphere and Proxmox only)

The VMClone controller is active in v0.3.8. Full and linked clones are supported when the source is a vmRef on the same provider. Libvirt returns Unimplemented.

Networking Examples

Advanced Provider Examples

Minimal clone example:

apiVersion: infra.virtrigaud.io/v1beta1
kind: VMClone
metadata:
  name: my-clone
  namespace: default
spec:
  source:
    vmRef:
      name: source-vm
      namespace: default
  targetName: my-clone-target
  classRef:
    name: small
    namespace: default
  options:
    type: Full      # or Linked

VMSet not functional in v0.3.8

VMSet resources are accepted by the API server but the controller stub immediately sets Ready=False / Reason=ControllerNotImplemented. Do not use VMSet for production workloads.

v0.2.1 Feature Examples

The following examples were added for v0.2.1 features and are still valid in v0.3.8:

Advanced Provider Examples

Migration Examples

Storage and migration direction constraints

storage.type: pvc is the only accepted value. S3, NFS, block, and live storage backends do not exist in the CRD and will be rejected by the controller. Additionally, only the vSphere → Libvirt migration direction is tested; other source/target pairs are documented but not validated in production. See Migration User Guide for details.

Advanced Examples

See the advanced/ subdirectory for:

Nested Virtualization

Usage Patterns

Apply an example

kubectl apply -f examples/provider-vsphere.yaml
kubectl apply -f examples/vmimage-ubuntu.yaml
kubectl apply -f examples/vm-ubuntu-small.yaml

Watch VM status

kubectl get vm my-vm -w

Get console URL

kubectl get vm my-vm -o jsonpath='{.status.consoleURL}'

Trigger VM reconfiguration

kubectl patch virtualmachine my-vm --type='merge' \
  -p='{"spec":{"classRef":{"name":"medium"}}}'

File Organization

src/examples/
├── index.md                           # This file
├── complete-example.yaml             # Complete setup
├── v021-feature-showcase.yaml        # v0.2.1 features
├── vm-ubuntu-small.yaml              # Simple VM
├── vmclass-small.yaml                # Basic VMClass
├── provider-vsphere.yaml             # vSphere provider
├── provider-libvirt.yaml             # Libvirt provider
├── vmimage-ubuntu.yaml               # VM image
├── vmnetwork-app.yaml                # Network attachment
├── graceful-shutdown-examples.yaml   # Graceful shutdown
├── vsphere-hardware-versions.yaml    # Hardware versions
├── disk-sizing-examples.yaml         # Disk sizing
├── vmmigration-basic.yaml            # Migration (tested)
├── vmmigration-advanced.yaml         # Migration with mapping
├── nested-virtualization.yaml        # Nested virt VMClass
├── advanced/                         # Complex scenarios
├── secrets/                          # Secret management
└── security/                         # Security configurations

Version Compatibility

  • v0.3.8: All examples in this directory; VMClone examples require v0.3.8+
  • v0.3.x: Examples are backward compatible within the v0.3.x line (VMClone examples require v0.3.8)
  • v0.2.x and older: Not supported

See Also