This demo compares a normal container runtime (runc) vs gVisor using the
demo-nginx and demo-nginx-gvisor deployments in the cydu namespace.
bash
minikube start --container-runtime=containerd
minikube addons enable gvisor
bash
kubectl apply -f k8s/demo-gvisor.yaml
RuntimeClass name:
bash
kubectl get pods -n cydu -o custom-columns=NAME:.metadata.name,RUNTIMECLASS:.spec.runtimeClassName
Behavior check using dmesg:
Get pod names:
bash
kubectl get pods -n cydu
Check dmesg output:
bash
kubectl exec -n cydu <demo-nginx-pod> -- dmesg | head -n 5
kubectl exec -n cydu <demo-nginx-gvisor-pod> -- dmesg | head -n 5
Clear dmesg inside the pod:
bash
kubectl exec -n cydu <demo-nginx-pod> -- dmesg -C
kubectl exec -n cydu <demo-nginx-gvisor-pod> -- dmesg -C
Notes:
dmesg -C clears the host kernel ring buffer.dmesg -C clears only the synthetic gVisor buffer.If you want a demo that fails in gVisor but succeeds in runc, use ptrace
(strace -p 1) or mount (with CAP_SYS_ADMIN).