Skip to content

Commit

Permalink
Update KubeVirt quickstart guide
Browse files Browse the repository at this point in the history
The KubeVirt sections in the quickstart guide are a bit old, and are
not working as expected, as result of changes in several components.

This PR updates the old KubeVirt sections, to a working instructions. In
addition, the guide now presents all the supported boot images.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
  • Loading branch information
nunnatsa committed Jan 22, 2025
1 parent da9bc79 commit e9cd72b
Showing 1 changed file with 46 additions and 13 deletions.
59 changes: 46 additions & 13 deletions docs/book/src/user/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ a target [management cluster] on the selected [infrastructure provider].
#### Install the Calico CNI
Now we'll need to install a CNI. In this example, we're using calico, but other CNIs should work as well. Please see
[calico installation guide](https://projectcalico.docs.tigera.io/getting-started/kubernetes/self-managed-onprem/onpremises#install-calico)
for more details (use the "Manifest" tab). Below is an example of how to install calico version v3.24.4.
for more details (use the "Manifest" tab). Below is an example of how to install calico version v3.29.1.
Use the Calico manifest to create the required resources; e.g.:
```bash
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.4/manifests/calico.yaml
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.1/manifests/calico.yaml
```
{{#/tab }}
Expand Down Expand Up @@ -652,20 +652,39 @@ kubectl wait pods -n metallb-system -l app=metallb,component=controller --for=co
kubectl wait pods -n metallb-system -l app=metallb,component=speaker --for=condition=Ready --timeout=2m
```
Now, we'll create the `IPAddressPool` and the `L2Advertisement` custom resources. The script below creates the CRs with
the right addresses, that match to the kind cluster addresses:
Now, we'll create the `IPAddressPool` and the `L2Advertisement` custom resources. For that, we'll need to set the IP
range. First, we'll read the `kind` network, in order to find its subnet:
```bash
GW_IP=$(docker network inspect -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}' kind)
NET_IP=$(echo ${GW_IP} | sed -E 's|^([0-9]+\.[0-9]+)\..*$|\1|g')
cat <<EOF | sed -E "s|172.19|${NET_IP}|g" | kubectl apply -f -
docker network inspect kind
```
The result will be something like this:
```bash
[
{
"name": "kind",
...
"subnets": [
...
{
"subnet": "10.89.0.0/24",
"gateway": "10.89.0.1"
}
],
...
```
In this example, the mask is 24 bits, so we'll set the IP range within this subnet; e.g `10.89.0.200-10.89.0.250`
We'll use this range to create the metalLB IP Address Pool (and the L2Advertisement CR), like this:
```bash
cat <<EOF | kubectl apply -f -
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: capi-ip-pool
namespace: metallb-system
spec:
addresses:
- 172.19.255.200-172.19.255.250
- 10.89.0.200-10.89.0.250
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
Expand Down Expand Up @@ -1184,10 +1203,24 @@ Please visit the [KubeKey provider] for more information.
{{#/tab }}
{{#tab KubeVirt}}
```bash
export CAPK_GUEST_K8S_VERSION="v1.23.10"
export CRI_PATH="/var/run/containerd/containerd.sock"
export NODE_VM_IMAGE_TEMPLATE="quay.io/capk/ubuntu-2004-container-disk:${CAPK_GUEST_K8S_VERSION}"
The following VM imagees are available:
* `quay.io/capk/ubuntu-2004-container-disk:v1.22.0`
* `quay.io/capk/ubuntu-2004-container-disk:v1.23.10`
* `quay.io/capk/ubuntu-2004-container-disk:v1.24.9`
* `quay.io/capk/ubuntu-2004-container-disk:v1.25.5`
* `quay.io/capk/ubuntu-2004-container-disk:v1.26.0`
* `quay.io/capk/ubuntu-2204-container-disk:v1.27.14`
* `quay.io/capk/ubuntu-2204-container-disk:v1.28.10`
* `quay.io/capk/ubuntu-2204-container-disk:v1.29.5`
* `quay.io/capk/ubuntu-2204-container-disk:v1.30.1`
* `quay.io/capk/ubuntu-2404-container-disk:v1.31.5`
* `quay.io/capk/ubuntu-2404-container-disk:v1.32.1`
In this example, we'll use the image for kubernetes v1.32.1:
```bash
export NODE_VM_IMAGE_TEMPLATE="quay.io/capk/ubuntu-2404-container-disk:v1.32.1"
export CAPK_GUEST_K8S_VERSION="${NODE_VM_IMAGE_TEMPLATE/:*/}"
export CRI_PATH="unix:///var/run/containerd/containerd.sock"
```
Please visit the [KubeVirt project][KubeVirt provider] for more information.
Expand Down Expand Up @@ -1727,7 +1760,7 @@ are enough for these two CNI to work on (actually) the same environment.
The following script downloads the Calico manifest and modifies the required field. The CIDR and the port values are examples.
```bash
curl https://raw.githubusercontent.com/projectcalico/calico/v3.24.4/manifests/calico.yaml -o calico-workload.yaml
curl https://raw.githubusercontent.com/projectcalico/calico/v3.29.1/manifests/calico.yaml -o calico-workload.yaml
sed -i -E 's|^( +)# (- name: CALICO_IPV4POOL_CIDR)$|\1\2|g;'\
's|^( +)# ( value: )"192.168.0.0/16"|\1\2"10.243.0.0/16"|g;'\
Expand Down

0 comments on commit e9cd72b

Please sign in to comment.