Install with scripts (k3s)

This procedure creates a single node k3s cluster on the host, install KNL and all required components.

0. host requirements

The host must be Linux/x86-64 with sufficient CPU, memory, and storage for your lab nodes; nested virtualization may be needed for VM-based node types; a storage class that supports PVCs is required (k3s local-path is used by default).

1. clone the knl repository

git clone https://github.com/hujun-open/knl.git
cd knl

2. run the install scripts

One command installs k3s and all KNL components:

sudo ./scripts/setup-k3s.sh --install

Or run in two steps (cluster first, then KNL):

sudo ./scripts/setup-k3s.sh
source ./scripts/knl-env.sh
./scripts/install-knl.sh

Components installed:

Cluster and host (via setup-k3s.sh):

  • k3s (single-node Kubernetes)
  • Local image registry (registry:2, NodePort 30500 by default; omitted with --skip-registry)
  • Helm and k9s (host binaries)
  • IPv6 forwarding enabled on the host (required by k8slan)

KNL stack (via install-knl.sh):

  • cert-manager v1.17.2
  • KubeVirt v1.6.3 and CDI v1.63.1 (with KNL-required feature gates and macvtap tap binding)
  • Multus CNI
  • containernetworking CNI plugins (e.g. bridge)
  • k8slan
  • KNL operator in namespace knl-system, including knl-pvc PVC (10Gi, storage class local-path by default)
  • knlcli installed to /usr/local/bin/knlcli

Default versions can be overridden via KNL_* env vars. You still need to meet the requirements for the underlying host.

3. create a KNLConfig

Create a KNLConfig YAML with your desired configuration and apply it:

kubectl -n knl-system apply -f knlcfg.yaml

4. update knl-sftp secret (optional)

knl-sftp secret in knl-system namespace holds the login credential for KNL SFTP server; by default both username and password is knlftp.

kubectl -n knl-system edit secret knl-sftp

5. provision licenses

Some node types require a license secret. Example for vSIM:

kubectl -n knl-system create secret generic vsimlic --from-file=license=<lic_file>

See node types for default secret names.

6. create a Lab

Define your topology in a Lab CR YAML and apply it:

kubectl -n knl-system apply -f lab.yaml

See the quickstart for an example.