You'll need the following to run the local environment:

  • SELinux/AppArmor disabled on the host (to disable them, follow the documentation ofthe Linux distribution that you run on the host)
  • if host have libvirt installed, it should be stopped when working with Virtlet
  • Docker should be installed on the host and the user account on which Virtlet will be built and run should be properly configured to use that Docker daemon (likely adding the user account into the group in which Docker deamon is running should be enough, but please follow the Docker documentation for your Linux distribution),
  • kubeadm-dind-cluster script for Kubernetes version 1.14 (

You can get the cluster startup script like this:

$ wget -O ~/
$ chmod +x ~/

Running the local environment

In order to start locally-built Virtlet and CRI proxy on kubeadm-dind-cluster:

$ # Remove any previous build container & related docker volumes
$ # This is optional step that should be done if the build container
$ # doesn't match current Virtlet sources (i.e. is too old)
$ build/ clean

$ # build Virtlet binaries & the image
$ build/ build

$ # start DIND cluster
$ ~/ up

$ # copy binaries to kube-node-1
$ build/ copy-dind

$ # inject Virtlet image into the DIND node and start the Virtlet DaemonSet
$ build/ start-dind

$ # run some e2e tests
$ build/ e2e -test.v

$ # run e2e tests that have 'Should have default route' in their description
$ build/ e2e -test.v -ginkgo.focus="Should have default route"

$ # Restart the DIND cluster. Binaries from copy-dind are preserved
$ # (you may copy newer ones with another copy-dind command)
$ ~/ up

$ # start Virtlet daemonset again
$ build/ start-dind

You may use flannel instead of default CNI bridge networking for the test cluster. To do so, set CNI_PLUGIN environment variable:

$ export CNI_PLUGIN=flannel

Virtlet uses KVM if it's available by default. To disable it for your local development environment, set VIRTLET_DISABLE_KVM environment variable to a non-empty value before running build/ start-dind.