Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📖 Update KubeVirt quickstart guide #11734

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 37 additions & 12 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.
nunnatsa marked this conversation as resolved.
Show resolved Hide resolved
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,23 @@ 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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
range. First, we'll read the `kind` network, in order to find its subnet:
range. First, we'll read the `kind` network in order to find its subnet:

Nit

For example:
Comment on lines +657 to +658
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove these two lines. IMO we want to provide a code snippet that should work verbatim for most use cases. We already have that. The comment you've added below clarifies that for other runtimes the user should figure out the network manually.

```bash
GW_IP=$(docker network inspect -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}' kind)
nunnatsa marked this conversation as resolved.
Show resolved Hide resolved
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 -
SUB_NET=$(docker network inspect -f '{{range .IPAM.Config}}{{if .Gateway}}{{.Subnet}}{{end}}{{end}}' kind)
PREFIX=$(echo $SUB_NET | sed -E 's|^([0-9]+\.[0-9]+)\..*$|\1|g')
Comment on lines +660 to +661
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SUB_NET=$(docker network inspect -f '{{range .IPAM.Config}}{{if .Gateway}}{{.Subnet}}{{end}}{{end}}' kind)
PREFIX=$(echo $SUB_NET | sed -E 's|^([0-9]+\.[0-9]+)\..*$|\1|g')
SUBNET=$(docker network inspect -f '{{range .IPAM.Config}}{{if .Gateway}}{{.Subnet}}{{end}}{{end}}' kind)
PREFIX=$(echo $SUBNET | sed -E 's|^([0-9]+\.[0-9]+)\..*$|\1|g')

Nit: Subnet is one word.

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
- ${PREFIX}.255.200-${PREFIX}.255.250
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
Expand All @@ -675,6 +678,16 @@ metadata:
EOF
```
<aside class="note warning">
<h1>Notice</h1>
The above example is based on docker runtime. The result of `docker network inspect` may be different when using another
container runtime. In this case, the IPAddressPool's `spec.address` field should be populated manually, according to
the specific network configuration.
Comment on lines +685 to +687
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The above example is based on docker runtime. The result of `docker network inspect` may be different when using another
container runtime. In this case, the IPAddressPool's `spec.address` field should be populated manually, according to
the specific network configuration.
The example above is based on the Docker container runtime. The output of `docker network inspect` may be different when using another
runtime. In such a case, the IPAddressPool's `spec.addresses` field should be populated manually, according to the specific network
configuration.

This looks better to me. Suggesting some nitpicks about language.

</aside>
#### Install KubeVirt on the kind cluster
```bash
# get KubeVirt version
Expand Down Expand Up @@ -1184,13 +1197,25 @@ Please visit the [KubeKey provider] for more information.
{{#/tab }}
{{#tab KubeVirt}}
In this example, we'll use the image for kubernetes v1.32.1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this example, we'll use the image for kubernetes v1.32.1:
In this example, we'll use the image for Kubernetes v1.32.1:

Nit - let's capitalize names consistently.

```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}"
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.
<aside class="note">
<h1>Note</h1>
Find additional images under [quay.io/capk/ubuntu-2404-container-disk](https://quay.io/capk/ubuntu-2404-container-disk),
[quay.io/capk/ubuntu-2204-container-disk](https://quay.io/capk/ubuntu-2204-container-disk),
or [quay.io/capk/ubuntu-2004-container-disk](https://quay.io/capk/ubuntu-2004-container-disk)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
or [quay.io/capk/ubuntu-2004-container-disk](https://quay.io/capk/ubuntu-2004-container-disk)
or [quay.io/capk/ubuntu-2004-container-disk](https://quay.io/capk/ubuntu-2004-container-disk).

Nit

Alternatively, create your own image; see [here](https://github.com/kubernetes-sigs/image-builder).
</aside>
{{#/tab }}
{{#tab Metal3}}
Expand Down Expand Up @@ -1727,7 +1752,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
Loading