Skip to content

Kubevirt Community Stack

This app deploys all the resources you need to get started with Kubevirt on your existing cluster: see https://github.com/cloudymax/kubevirt-community-stack.

The Kubevirt-Community-Stack may be of interest if you:

  • operate one or more physical computers which you would like to split into smaller virtual machines.
  • are already running kubernetes to orchestrate container workloads
  • are already in the ArgoCD or Tekton ecosystem and/or work primarily with some other Helm-based tooling.
  • want/need fully-featured VMs for things like hardware emulation, hardware-passthrough, Virtual Desktops, vGPU, etc... which are not suppoted by Micro-VMs such as Firecracker.
  • want to integrate Kubevirt into your existing infrastructure without needing to adopt a full platform like OpenShift Virtuazation, HarvesterHCI, StarlingX, or KubeSphere etc...
  • want to install and operate Kubevirt on an existing system withhout needing to re-image it with an installer ISO.
  • desire tight integration with cloud-init while respecting git-ops best practices
  • prefer to use cloud-init for system configuration over ansible & packer based workflows

Components

Kubervirt
Kubevirt is a Kubernetes Virtualization API and runtime which controls QEMU/KVM virtual machine instances and provides the CRDs that define them. It's distrubuted as a Kubernetes Operator which is install via the kubevirt chart.

Kubevirt CDI
The Containerized Data Importer can pull virtual machine images, ISO files, and other types of bootable media from sources like S3, HTTP, or OCI images. This data is then written to PVCs which are mounted as disks. For examples of various ways to use the CDI, see the notes in Argocd-Apps

Cloud-Init
The Cloud-init helm chart allows the user to define the specification of a linux-based vm's operating system as code. In addition to basec cloud-init functions, his chart provides some extra functionality via an initjob that makes cloud-init more GitOps friendly.

Additional Features: - Regex values using existing secrets or environmental variables via envsubst - Create random user passwords or use an existing secret - Download files from a URL - Base64 encode + gzip your `write_files` content - Populate Wireguard configuration values from an existsing secret - Track the total size of user-data and check file for valid syntax

Kubevirt VM
The Kubevirt-VM Chart allows a user to easily template a Kubevirt VirtualMachine or VirtualMachinePool and its associated resources sudch as Disks, DataVolumes, Horizontal Pod Autoscaler, Network Policies, Service, Ingres, Probes, and Cloud-init data (via bundled cloud-init subchart).

Kubevirt Manager
This is a community-developed web-ui which allows users to create, manage, and interact with virtual machines running in Kubevirt. See their official docs at kubevirt-manager.io

Screenshot showing the default page of Kubevirt-manager. The screen is devided into 2 sections. On the left, there is a vertical navigation tab with a grey background. The options in this bar are Dashboard, Virtual Machines, VM Pools, Auto Scaling, Nodes, Data Volumes, Instance Types, and Load Balancers.  On the right, there is a grid of blue rectangular icons each representing one of the option in the navigation tab, but with an icon and text representing metrics about that option.



Cluster API Operator & Addons
Cluster API provides a standardised kubernetes-native interface for creating k8s clusters using a wide variety of providers. The combined chart can install the Cluster API Operator as well as bootstrap the Cluster API Kubevirt Provider which allows creating k8s clusters from the CLI or as YAML using Kubevirt VMs. Cluster-api-provider-kubevirt also includes cloud-provider-kubevirt which enables the exposeure of LoadBalancer type services within tenant clusters to the host cluster. This negates the need for a dedicated loadbalancer such as MetalLB inside the tenant cluster.

See CAPI.md for a basic walkthrough of creating a CAPI-based tenant cluster.

CAPI Cluster
The CAPI Cluster helm chart provides a way to create workload clusters using the Kubevirt infrastructure, Kubeadm Bootstrap + ControlPlane, and Helm providers.

Example Config:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  kubevirt:
    description: |
      [link=https://kubevirt.io/]kubevirt[/link] lets you manage virtual machines via Kubernetes.
    # default disabled while a helm chart is being actively developed
    enabled: false
    argo:
      # secret keys to provide for the argocd secret plugin app, none by default
      secret_keys:
        webui_hostname: kubevirt.example.com
      # git repo to install the Argo CD app from
      repo: https://github.com/small-hack/argocd-apps
      # path in the argo repo to point to. Trailing slash very important!
      path: kubevirt/
      # either the branch or tag to point at in the argo repo above
      revision: main
      # kubernetes cluster to install the k8s app into, defaults to Argo CD default
      cluster: https://kubernetes.default.svc
      # namespace to install the k8s app in
      namespace: kubevirt
      # recurse directories in the provided git repo
      directory_recursion: false
      # source repos for Argo CD App Project (in addition to argo.repo)
      project:
        name: kubevirt
        source_repos:
          - https://github.com/small-hack/argocd-apps
          - https://cloudymax.github.io/kubevirt-community-stack/
          - https://github.com/cloudymax/kubevirt-community-stack.git
          - https://cloudymax.github.io/kubevirt-community-stack
        destination:
          # automatically includes the app's namespace and argocd's namespace
          namespaces:
            - kubevirt-manager
            - kube-system
            - kubevirt
            - prometheus
            - default
            - windows10
            - debian12
            - cdi
            - capi-operator-system
            - kubeadm-bootstrap-system
            - kubevirt-infrastructure-system
            - kubeadm-control-plane-system
            - capi-system