summaryrefslogtreecommitdiffhomepage
path: root/g3doc/user_guide/runtimeclass.md
diff options
context:
space:
mode:
Diffstat (limited to 'g3doc/user_guide/runtimeclass.md')
-rw-r--r--g3doc/user_guide/runtimeclass.md44
1 files changed, 44 insertions, 0 deletions
diff --git a/g3doc/user_guide/runtimeclass.md b/g3doc/user_guide/runtimeclass.md
new file mode 100644
index 000000000..9f2d794c3
--- /dev/null
+++ b/g3doc/user_guide/runtimeclass.md
@@ -0,0 +1,44 @@
+# RuntimeClass
+
+First, follow the appropriate installation instructions for your version of
+containerd.
+
+* For 1.1 or lower, use `gvisor-containerd-shim`.
+* For 1.2 or higher, use `containerd-shim-runsc-v1`.
+
+# Set up the Kubernetes RuntimeClass
+
+Creating the RuntimeClass in kubernetes is simple once the runtime is available
+for containerd:
+
+```shell
+cat <<EOF | kubectl apply -f -
+apiVersion: node.k8s.io/v1beta1
+kind: RuntimeClass
+metadata:
+ name: gvisor
+handler: runsc
+EOF
+```
+
+Pods can now be created using this RuntimeClass:
+
+```shell
+cat <<EOF | kubectl apply -f -
+apiVersion: v1
+kind: Pod
+metadata:
+ name: nginx-gvisor
+spec:
+ runtimeClassName: gvisor
+ containers:
+ - name: nginx
+ image: nginx
+EOF
+```
+
+You can verify that the Pod is running via this RuntimeClass:
+
+```shell
+kubectl get pod nginx-gvisor -o wide
+```