KubeVirt: Difference between revisions
No edit summary |
|||
Line 16: | Line 16: | ||
===Install KubeVirt=== | ===Install KubeVirt=== | ||
See [https://kubevirt.io/user-guide/operations/installation/ installation] | See [https://kubevirt.io/user-guide/operations/installation/ installation] | ||
{{hidden | Install commands | | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Get the latest version string | # Get the latest version string | ||
Line 34: | Line 35: | ||
sudo install virtctl /usr/local/bin | sudo install virtctl /usr/local/bin | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | |||
===Creating a VM=== | ===Creating a VM=== |
Revision as of 19:10, 13 February 2022
KubeVirt lets you setup and manage virtual machines on your kubernetes cluster.
Getting Started
Background
KubeVirt creates two new types of resources on your cluster: VirtualMachine
(vm) and VirtualMachineInstance
(vmi).
VirtualMachine
defines how to create VMIs. VirtualMachineInstance
represent a running virtual machine.
Similar to deployments-pods, you will typically not create VirtualMachineInstance
manually.
Instead you define VirtualMachine
in your manifests and control them using virtctl
. Then KubeVirt will automatically create VirtualMachineInstance
.
Requirements
See requirements
- You need a kubernetes cluster with
kubectl
set up. - You do not need to install
qemu-kvm libvirt-daemon-system
on the nodes.
Install KubeVirt
See installation
Install commands
# Get the latest version string
export VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases | grep tag_name | grep -v -- '-rc' | sort -r | head -1 | awk -F': ' '{print $2}' | sed 's/,//' | xargs)
echo $VERSION
# Deploy operator
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-operator.yaml
# Deploy custom resources
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-cr.yaml
# Install virtctl
VERSION=$(kubectl get kubevirt.kubevirt.io/kubevirt -n kubevirt -o=jsonpath="{.status.observedKubeVirtVersion}")
ARCH=$(uname -s | tr A-Z a-z)-$(uname -m | sed 's/x86_64/amd64/') || windows-amd64.exe
echo ${ARCH}
curl -L -o virtctl https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/virtctl-${VERSION}-${ARCH}
chmod +x virtctl
sudo install virtctl /usr/local/bin