{"id":13509245,"url":"https://github.com/smartxworks/virtink","last_synced_at":"2025-04-15T03:52:08.009Z","repository":{"id":37727074,"uuid":"498171652","full_name":"smartxworks/virtink","owner":"smartxworks","description":"Lightweight Virtualization Add-on for Kubernetes","archived":false,"fork":false,"pushed_at":"2024-12-11T03:39:15.000Z","size":804,"stargazers_count":545,"open_issues_count":10,"forks_count":43,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-15T03:52:02.758Z","etag":null,"topics":["cloud-hypervisor","kubernetes","kvm","rust-vmm","virtualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartxworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-31T03:22:47.000Z","updated_at":"2025-04-11T09:19:30.000Z","dependencies_parsed_at":"2024-01-11T05:20:29.954Z","dependency_job_id":"5fa0e833-1d66-434e-89b7-858a0a3054bf","html_url":"https://github.com/smartxworks/virtink","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fvirtink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fvirtink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fvirtink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fvirtink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartxworks","download_url":"https://codeload.github.com/smartxworks/virtink/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003954,"owners_count":21196794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-hypervisor","kubernetes","kvm","rust-vmm","virtualization"],"created_at":"2024-08-01T02:01:05.158Z","updated_at":"2025-04-15T03:52:07.980Z","avatar_url":"https://github.com/smartxworks.png","language":"Go","funding_links":[],"categories":["Go","kubernetes"],"sub_categories":[],"readme":"# Virtink: Lightweight Virtualization Add-on for Kubernetes\n\n[![build](https://github.com/smartxworks/virtink/actions/workflows/build.yml/badge.svg)](https://github.com/smartxworks/virtink/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/smartxworks/virtink)](https://goreportcard.com/report/github.com/smartxworks/virtink)\n[![codecov](https://codecov.io/gh/smartxworks/virtink/branch/main/graph/badge.svg?token=6GXYM2BFLT)](https://codecov.io/gh/smartxworks/virtink)\n\nVirtink is a [Kubernetes](https://github.com/kubernetes/kubernetes) add-on for running [Cloud Hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor) virtual machines. By using Cloud Hypervisor as the underlying hypervisor, Virtink enables a lightweight and secure way to run fully virtualized workloads in a canonical Kubernetes cluster.\n\nCompared to [KubeVirt](https://github.com/kubevirt/kubevirt), Virtink:\n\n- does not use libvirt or QEMU. By leveraging Cloud Hypervisor, VMs has lower memory (≈30MB) footprints, higher performance and smaller attack surface.\n- does not require a long-running per-Pod launcher process, which further reduces runtime memory overhead (≈80MB).\n- is an especially good fit for running fully isolated Kubernetes clusters in an existing Kubernetes cluster. See our [Cluster API provider](https://github.com/smartxworks/cluster-api-provider-virtink) and the [knest](https://github.com/smartxworks/knest) tool for more details.\n\nVirtink consists of 3 components:\n\n- `virt-controller` is the cluster-wide controller, responsible for creating Pods to run Cloud Hypervisor VMs.\n- `virt-daemon` is the per-Node daemon, responsible for further controlling Cloud Hypervisor VMs on Node bases.\n- `virt-prerunner` is the per-Pod pre-runner, responsible for preparing VM networks and building Cloud Hypervisor VM configuration.\n\n**NOTE**: Virtink is still a work in progress, its API may change without prior notice.\n\n## Installation\n\n### Requirements\n\nA few requirements need to be met before you can begin:\n\n- Kubernetes cluster v1.16 ~ v1.25\n- Kubernetes apiserver must have `--allow-privileged=true` in order to run Virtink's privileged DaemonSet. It's usually set by default.\n- [cert-manager](https://cert-manager.io/) v1.0 ~ v1.8 installed in Kubernetes cluster. You can install it with `kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.2/cert-manager.yaml`.\n\n#### Container Runtime Support\n\nVirtink currently supports the following container runtimes:\n\n- Docker\n- containerd\n\nOther container runtimes, which do not use virtualization features, should work too. However, they are not tested officially.\n\n#### Hardware Virtualization Support\n\nHardware with virtualization support is required. You should check if `/dev/kvm` exists on each Kubernetes nodes.\n\n#### Host Kernel Version\n\n- Minimum: v4.11\n- Recommended: v5.6 or above\n\n### Install Virtink\n\nInstall all Virtink components:\n\n```bash\nkubectl apply -f https://github.com/smartxworks/virtink/releases/download/v0.13.0/virtink.yaml\n```\n\nOnce you have deployed Virtink, you can [create your virtual machines](#create-a-vm).\n\n## Getting Started\n\n### Create a VM\n\nApply the following manifest to Kubernetes. Note it uses a [container rootfs](samples/Dockerfile.container-rootfs-ubuntu) and as such doesn’t persist data.\n\n```bash\ncat \u003c\u003cEOF | kubectl apply -f -\napiVersion: virt.virtink.smartx.com/v1alpha1\nkind: VirtualMachine\nmetadata:\n  name: ubuntu-container-rootfs\nspec:\n  instance:\n    memory:\n      size: 1Gi\n    kernel:\n      image: smartxworks/virtink-kernel-5.15.12\n      cmdline: \"console=ttyS0 root=/dev/vda rw\"\n    disks:\n      - name: ubuntu\n      - name: cloud-init\n    interfaces:\n      - name: pod\n  volumes:\n    - name: ubuntu\n      containerRootfs:\n        image: smartxworks/virtink-container-rootfs-ubuntu\n        size: 4Gi\n    - name: cloud-init\n      cloudInit:\n        userData: |-\n          #cloud-config\n          password: password\n          chpasswd: { expire: False }\n          ssh_pwauth: True\n  networks:\n    - name: pod\n      pod: {}\nEOF\n```\n\nLike starting pods, it will take some time to pull the image and start running the VM. You can wait for the VM become running as follows:\n\n```bash\nkubectl wait vm ubuntu-container-rootfs --for jsonpath='{.status.phase}'=Running --timeout -1s\n```\n\n### Access the VM (via SSH)\n\nThe easiest way to access the VM is via a SSH client inside the cluster. You can access the VM created above as follows:\n\n```bash\nexport VM_NAME=ubuntu-container-rootfs\nexport VM_POD_NAME=$(kubectl get vm $VM_NAME -o jsonpath='{.status.vmPodName}')\nexport VM_IP=$(kubectl get pod $VM_POD_NAME -o jsonpath='{.status.podIP}')\nkubectl run ssh-$VM_NAME --rm --image=alpine --restart=Never -it -- /bin/sh -c \"apk add openssh-client \u0026\u0026 ssh ubuntu@$VM_IP\"\n```\n\nEnter `password` when you are prompted to enter password, which is set by the cloud-init data in the VM manifest.\n\n### Manage the VM\n\nVirtink supports various VM power actions. For example, you can power off the VM created above as follows:\n\n```bash\nexport VM_NAME=ubuntu-container-rootfs\nexport POWER_ACTION=PowerOff\nkubectl patch vm $VM_NAME --subresource=status --type=merge -p \"{\\\"status\\\":{\\\"powerAction\\\":\\\"$POWER_ACTION\\\"}}\"\n```\n\nYou can also `Shutdown`, `Reset`, `Reboot` or `Pause` a running VM, or `Resume` a paused one. To start a powered-off VM, you can `PowerOn` it.\n\n## Demo Recording\n\n[![asciicast](https://asciinema.org/a/509484.svg)](https://asciinema.org/a/509484)\n\n## Roadmap\n\n- [x] VM lifecycle management\n- [x] [Container disks](docs/disks_and_volumes.md#containerdisk-volume)\n- [x] [Direct kernel boot](docs/direct_kernel_boot.md) with [container rootfs](docs/disks_and_volumes.md#containerrootfs-volume)\n- [x] [Pod network](docs/interfaces_and_networks.md#pod-network)\n- [x] [Multus CNI networks](docs/interfaces_and_networks.md#multus-network)\n- [x] [Persistent volumes](docs/disks_and_volumes.md#persistentvolumeclaim-volume)\n- [x] [CDI data volumes](docs/disks_and_volumes.md#datavolume-volume)\n- [x] ARM64 support\n- [x] VM live migration\n- [x] [SR-IOV NIC passthrough](docs/interfaces_and_networks.md#sriov-mode)\n- [ ] GPU passthrough\n- [x] [Dedicated CPU placement](docs/dedicated_cpu_placement.md)\n- [ ] VM devices hot-plug\n\n## License\n\nThis project is distributed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartxworks%2Fvirtink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartxworks%2Fvirtink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartxworks%2Fvirtink/lists"}