This workshop demonstrates how to run virtual machines (VMs) on Kubernetes using KubeVirt and Civo's managed Kubernetes platform. You'll learn to create VMs, deploy services within them, and establish bidirectional communication between VMs and Kubernetes cluster services.
This diagram shows the complete workshop architecture, demonstrating how VMs integrate with Kubernetes services, storage, and external access through Civo's LoadBalancer.
By the end of this workshop, you will have:
- Created a Kubernetes cluster on Civo
- Installed and configured KubeVirt
- Validated KubeVirt with a lightweight CirrOS VM
- Installed CDI for full Linux VM support
- Created and managed Ubuntu virtual machines
- Deployed services within VMs
- Established bidirectional communication between VMs and Kubernetes services
- Exposed VM services to the internet via LoadBalancer
Before starting this workshop, ensure you have:
- Civo workshop account - Sign up at civo.com
- kubectl - Kubernetes command-line tool (installation guide)
- virtctl - We'll guide you through the installation during the workshop
- Clone this repository
git clone https://github.com/DMajrekar/kubevirt-civo-workshop.git cd kubevirt-civo-workshop
This workshop is organized into step-by-step directories:
kubevirt-civo-workshop/
├── step-01-cluster-setup/ # Civo cluster creation
├── step-02-kubevirt-installation/ # KubeVirt operator setup
├── step-03-initial-vm-validation/ # CirrOS VM for validation
├── step-04-cdi-installation/ # CDI for full Linux VMs
├── step-05-vm-creation/ # Ubuntu VM creation
├── step-06-vm-services/ # Deploy services in VMs
├── step-07-expose-services/ # Kubernetes service exposure
├── step-08-vm-to-cluster/ # Test VM → cluster communication
├── step-09-external-access/ # LoadBalancer for internet access
├── step-99-cleanup/ # Resource cleanup
├── docs/ # Additional documentation
├── CLAUDE.md # Claude Code automation
└── README.md # This workshop guide
Follow these step-by-step guides:
- Step 1: Civo Cluster Setup - Create and configure your Kubernetes cluster
- Step 2: KubeVirt Installation - Install KubeVirt operator and components
- Step 3: Initial VM Validation - Install virtctl and validate with CirrOS VM
- Step 4: CDI Installation - Install CDI for full Linux VM support
- Step 5: VM Creation - Create Ubuntu VMs using CDI DataVolumes
- Step 6: VM Services - Deploy applications within VMs
- Step 7: Expose Services - Expose VM services via Kubernetes
- Step 8: VM to Cluster - Test VM → cluster communication
- Step 9: External Access - Expose services to the internet
- Step 99: Cleanup - Clean up all workshop resources
Each step contains:
- Clear objectives and prerequisites
- Detailed instructions
- Relevant files and manifests
- Troubleshooting guidance
- Links to the next step
For detailed troubleshooting information, see docs/troubleshooting.md.
-
VM Won't Start
kubectl describe vm testvm kubectl get events --field-selector involvedObject.name=testvm
-
Can't Connect to VM Console
- Ensure VM is running:
kubectl get vmis - Check VM events:
kubectl describe vmi testvm
- Ensure VM is running:
-
Service Not Accessible
- Check service endpoints:
kubectl get endpoints testvm-service - Verify VM is running and service is active inside VM
- Check service endpoints:
-
LoadBalancer External IP Pending
- This is normal on Civo, it may take 2-5 minutes
- Check service status:
kubectl describe svc testvm-loadbalancer
- How to set up KubeVirt on a Kubernetes cluster
- Creating and managing virtual machines in Kubernetes
- Running services within VMs
- Networking between VMs and Kubernetes services
- Exposing VM services to the internet
- The power of combining traditional VMs with cloud-native Kubernetes
- Explore more KubeVirt features like persistent storage
- Try different VM operating systems
- Implement more complex networking scenarios
- Look into VM migration capabilities
