Create a RuntimeClass named "gVisor" using the handler "runsc"
Create a pod named "gVisor-pod" that uses the nginx image in the namespace "test" which utilises the runtime class "gVisor"
Solution
### Solution
apiVersion: node.k8s.io/v1 # RuntimeClass is defined in the node.k8s.io API group
kind: RuntimeClass
metadata:
name: gVisor # The name the RuntimeClass will be referenced by
# RuntimeClass is a non-namespaced resource
handler: runsc # The name of the corresponding CRI configuration
vi ~/gVisor-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: gVisor-pod
name: gvisor-pod
namespace: test
spec:
runtimeClassName: gvisor ## use created runtimeclass here
containers:
- image: nginx
name: gVisor-pod
kubectl apply -f ~/gVisor-pod.yaml
kubectl run nginx-test --image=nginx
kubectl exec -it gVisor-pod -- bash dmesg
kubectl exec -it nginx-test --bash dmesg