https://gvisor.dev/docs/user_guide/quick_start/kubernetes/ Using Containerd
You can also setup Kubernetes nodes to run pods in gvisor using the containerd CRI runtime and the gvisor-containerd-shim. You can use either the io.kubernetes.cri.untrusted-workloadannotation or RuntimeClass to run Pods with runsc. You can find instructions here.
[centos@azuretest-1 root]$ kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME azuretest-1 Ready master 40d v1.17.0 192.168.0.26 CentOS Linux 7 (Core) 3.10.0-957.27.2.el7.x86_64 docker://1.13.1 azuretest-2 Ready 40d v1.17.0 192.168.0.6 CentOS Linux 7 (Core) 3.10.0-957.27.2.el7.x86_64 docker://1.13.1 [ce
https://gvisor.dev/docs/user_guide/install/
(
set -e
URL=https://storage.googleapis.com/gvisor/releases/nightly/latest
wget
Disable Docker service
Containerd Install in all worker nodes (if not already there).
Note Linux Keranl > 3.17 is needed Upgarde centos kernel as Centos ships with 3.10 usually google/gvisor-containerd-shim#45
https://linuxhint.com/upgrade-kernel-centos-7/ https://www.thegeekdiary.com/centos-rhel-7-change-default-kernel-boot-with-old-kernel/
Install https://github.com/containerd/cri/blob/master/docs/installation.md
VERSION=1.3.2 Need to install as a systemd serivce
Create a default configuration; This is used by other examples mkdir -p /etc/containerd [root@azuretest-1 ~]# containerd config default > /etc/containerd/config.toml
containerd config default > /etc/containerd/config.toml
Restart kubelet service with Docker service disabled. Check if it starts up succcessfully; If not refere here google/gvisor-containerd-shim#46 (comment)
Install gvisor-containerd-shim from binary in all worker nodes
https://github.com/google/gvisor-containerd-shim/blob/master/docs/untrusted-workload-quickstart.md
or
Install go and Build and install gvisor-containerd-shim and containerd-shim-runsc-v1 in all nodes
Test via cirtctl
Create gvisor Runtimeclass using runsc
Try to deploy a pod using Runtimeclass gvisor as per gvisor docs
Warning FailedCreatePodSandBox pod/nginx-gvisor Failed to create pod sandbox: rpc error: code = Unknown desc = RuntimeHandler "runsc" not supported
Check if kubelet is configured to use contaierd socker and containerd is configured with gvisor plugin also refer here and related google/gvisor-containerd-shim#46 (comment)