Skip to content

Commit 890003c

Browse files
committed
krunkit: Disable offloading for faster networking
krunkit-1.0.0[1] allows disabling offloading for faster networking. Keep the Offloading option in case offloading is improved in future versions or we want to add a flag to use int for specific workload. Testing shows 6.7 times faster network performance, and 9p mount is 3 times faster. Starting cluster: % minikube start --driver krunkit --container-runtime containerd 😄 minikube v1.36.0 on Darwin 15.6 (arm64) ✨ Using the krunkit (experimental) driver based on user configuration 👍 Starting "minikube" primary control-plane node in "minikube" cluster 🔥 Creating krunkit VM (CPUs=2, Memory=6144MB, Disk=20000MB) ... 📦 Preparing Kubernetes v1.33.2 on containerd 1.7.23 ... 🔗 Configuring bridge CNI (Container Networking Interface) ... 🔎 Verifying Kubernetes components... ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5 🌟 Enabled addons: default-storageclass, storage-provisioner 🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default Testing iperf3: % kubectl apply -f iper3-server.yaml deployment.apps/iperf3 created service/iperf3 created % kubectl get deploy iperf3 NAME READY UP-TO-DATE AVAILABLE AGE iperf3 1/1 1 1 9s % kubectl get service iperf3 NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE iperf3 NodePort 10.105.127.180 <none> 5201:30201/TCP 17s % iperf3 -c $(minikube ip) -p 30201 Connecting to host 192.168.105.10, port 30201 [ 5] local 192.168.105.1 port 50630 connected to 192.168.105.10 port 30201 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 1.05 GBytes 9.03 Gbits/sec [ 5] 1.00-2.01 sec 1.09 GBytes 9.29 Gbits/sec [ 5] 2.01-3.01 sec 1.06 GBytes 9.09 Gbits/sec [ 5] 3.01-4.00 sec 1.08 GBytes 9.33 Gbits/sec [ 5] 4.00-5.00 sec 1.08 GBytes 9.31 Gbits/sec [ 5] 5.00-6.00 sec 1.07 GBytes 9.23 Gbits/sec [ 5] 6.00-7.00 sec 1.09 GBytes 9.35 Gbits/sec [ 5] 7.00-8.01 sec 1.08 GBytes 9.20 Gbits/sec [ 5] 8.01-9.00 sec 1.07 GBytes 9.18 Gbits/sec [ 5] 9.00-10.01 sec 1.08 GBytes 9.28 Gbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 5] 0.00-10.01 sec 10.7 GBytes 9.23 Gbits/sec sender [ 5] 0.00-10.01 sec 10.7 GBytes 9.23 Gbits/sec receiver Testing 9p mount: % minikube mount ~/models:/mnt/models 📁 Mounting host path /Users/nir/models into VM as /mnt/models ... ▪ Mount type: 9p ▪ User ID: docker ▪ Group ID: docker ▪ Version: 9p2000.L ▪ Message Size: 262144 ▪ Options: map[] ▪ Bind Address: 192.168.105.1:50614 🚀 Userspace file server: ufs starting ✅ Successfully mounted /Users/nir/models to /mnt/models 📌 NOTE: This process must stay alive for the mount to be accessible ... $ time cat /mnt/models/DeepSeek-R1-0528-Qwen3-8B-Q4_K_M.gguf >/dev/null real 0m10.219s user 0m0.007s sys 0m0.263s [1] https://github.com/containers/krunkit/releases/tag/v1.0.0
1 parent af31c00 commit 890003c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pkg/drivers/krunkit/krunkit.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ func (d *Driver) startKrunkit(socketPath string) error {
229229
"--memory", fmt.Sprintf("%d", d.Memory),
230230
"--cpus", fmt.Sprintf("%d", d.CPU),
231231
"--restful-uri", d.restfulURI(),
232-
"--device", fmt.Sprintf("virtio-net,unixSocketPath=%s,mac=%s", socketPath, d.MACAddress),
232+
"--device", fmt.Sprintf("virtio-net,type=unixgram,path=%s,mac=%s,offloading=%t",
233+
socketPath, d.MACAddress, d.VmnetHelper.Offloading),
233234
"--device", fmt.Sprintf("virtio-serial,logFilePath=%s", d.serialPath()),
234235
"--krun-log-level", logLevelInfo,
235236

pkg/minikube/registry/drvs/krunkit/krunkit.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ func configure(cfg config.ClusterConfig, n config.Node) (interface{}, error) {
8686
VmnetHelper: vmnet.Helper{
8787
MachineDir: filepath.Join(storePath, "machines", machineName),
8888
InterfaceID: u,
89-
// Required Until https://github.com/containers/libkrun/issues/264 is fixed.
90-
Offloading: true,
9189
},
9290
}, nil
9391
}

site/content/en/docs/drivers/krunkit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ workloads.
1616
- Available only on Apple silicon.
1717
- Requires macOS 13 or later.
1818
- Requires minikube version 1.37.0 or later.
19-
- Requires krunkit version 0.2.2 or later.
19+
- Requires krunkit version 1.0.0 or later.
2020
- Requires [vmnet-helper](https://github.com/nirs/vmnet-helper).
2121

2222
## Installing krunkit

0 commit comments

Comments
 (0)