See this document for instructions.
The steps described here are performed automatically by demo.sh script.
- Start kubeadm-dind-cluster with Kubernetes version 1.8 (you're not required to download it to your home directory):
$ wget -O ~/dind-cluster-v1.8.sh https://cdn.rawgit.com/Mirantis/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.8.sh
$ chmod +x ~/dind-cluster-v1.8.sh
$ ~/dind-cluster-v1.8.sh up
$ export PATH="$HOME/.kubeadm-dind-cluster:$PATH"
The cluster script stores appropriate kubectl version in ~/.kubeadm-dind-cluster
.
- Label a node to accept Virtlet pod:
kubectl label node kube-node-1 extraRuntime=virtlet
- Deploy Virtlet DaemonSet (assuming that you have virtlet-ds.yaml in the current directory):
kubectl create -f virtlet-ds.yaml
- Wait for Virtlet pod to activate:
kubectl get pods -w -n kube-system
- Go to
examples/
directory and follow the instructions from there.
Virtlet can be customized through the virtlet-config
ConfigMap Kuberenetes object.
The following keys in the config map are honored by the virtlet-ds.yaml
:
disable_kvm
- disables KVM support and forces QEMU instead. Use "1" as a value.download_protocol
- default image download protocol - eitherhttp
orhttps
. The default is https.loglevel
- integer log level value for the virtlet written as a string (e.g. "3", "2", "1").calico-subnet
- netmask width for the Calico CNI. Default is "24".image_regexp_translation
- enables regexp syntax for the image name translation rules.disable_logging
- disables log streaming from VMs. Use "1" to disable.
In order to remove Virtlet, first you need to delete all the VM pods.
You can remove Virtlet DaemonSet with the following command:
kubectl delete daemonset -R -n kube-system virtlet
After that you can remove CRI Proxy if you're not going to use the node for Virtlet again by undoing the steps you made to install it (see CRI Proxy documentation).