Kubernetes
Security Warning
Running unikernels under kubernetes diminishes some of their security benefits, however, a lot of organizations still have heavy kubernetes installations so these are some ways you can still run unikernels in k8s.
Pre-requisites
You need access to hardware virtualization. If you are in the cloud the best way to get that is through NanoVMs Inception available on the AWS market. https://aws.amazon.com/marketplace/pp/prodview-lwk72eg6wfo3i. This will allow you to run kube-virt on plain old normal ec2 instances like an ec2.small without having to resort to expensive metal instances.
If you don't want to do that you'll either need a real physical computer or use metal instances.
Installing K8s / Initial Setup
Install KubeCtl:
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv kubectl /usr/local/bin/.
sudo mv kubectl /usr/local/bin/.
kubectl version --clientInstall Minikube:
curl -Lo minikube
https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
&& chmod +x minikube
minikube start --vm-driver=kvm2Install KVM tooling:
Ensure you are setup for KVM via libvirt and have associated permissions:
Install KubeVirt:
Create a Resource:
Install Virtctl:
Import CDI:
Building / Deploying
If you have the base kubernetes installation up and running you can move on to the final part.
You need to compress the disk image in question to xz format.
Now you need to upload that to a url for k8s to import.
Download a sample PVC template:
Edit the line to point to your xz'd image:
Import:
Create the Actual VM:
If you minikube ssh you should now be able to hit up your instance.
Last updated
Was this helpful?