Create a RuntimeClass named gvisor-rc using the prepared runtime handler named runsc.
Create a Pods of image Nginx in the Namespace server to run on the gVisor runtime class
See the explanation below:
Install the Runtime Class for gVisor
{ # Step 1: Install a RuntimeClass
cat <apiVersion: node.k8s.io/v1beta1kind: RuntimeClassmetadata:name: gvisorhandler: runscEOF}Create a Pod with the gVisor Runtime Class{ # Step 2: Create a podcat <apiVersion: v1kind: Podmetadata:name: nginx-gvisorspec:runtimeClassName: gvisorcontainers:- name: nginximage: nginxEOF}Verify that the Pod is running{ # Step 3: Get the podkubectl get pod nginx-gvisor -o wide}
apiVersion: node.k8s.io/v1beta1
kind: RuntimeClass
metadata:
name: gvisor
handler: runsc
EOF
}
Create a Pod with the gVisor Runtime Class
{ # Step 2: Create a pod
cat <apiVersion: v1kind: Podmetadata:name: nginx-gvisorspec:runtimeClassName: gvisorcontainers:- name: nginximage: nginxEOF}Verify that the Pod is running{ # Step 3: Get the podkubectl get pod nginx-gvisor -o wide}
apiVersion: v1
kind: Pod
name: nginx-gvisor
spec:
runtimeClassName: gvisor
containers:
- name: nginx
image: nginx
Verify that the Pod is running
{ # Step 3: Get the pod
kubectl get pod nginx-gvisor -o wide
Submit