diff options
author | Ian Lewis <ianlewis@google.com> | 2019-12-06 06:39:35 +0900 |
---|---|---|
committer | Fabricio Voznika <fvoznika@google.com> | 2019-12-05 13:39:35 -0800 |
commit | 757adfa287c17d925aec7976a86986bd5b52229c (patch) | |
tree | 9ff6d8c3422a3ce4ca9d1f5929a8bbb780f96f4e /docs | |
parent | 1547f2451927d95f9da1a24479e57a47405dc1ed (diff) |
Add docs for Kubernetes Runtime Class. (#33)
Adds doc to explicitly create the Kubernetes RuntimeClass object needed
to use the shim via the Kubernetes API.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/runtime-handler-quickstart.md | 45 | ||||
-rw-r--r-- | docs/runtime-handler-shim-v2-quickstart.md | 45 |
2 files changed, 90 insertions, 0 deletions
diff --git a/docs/runtime-handler-quickstart.md b/docs/runtime-handler-quickstart.md index e48b2dd1a..684390b55 100644 --- a/docs/runtime-handler-quickstart.md +++ b/docs/runtime-handler-quickstart.md @@ -204,3 +204,48 @@ sudo crictl inspect ${CONTAINER_ID} sudo crictl exec ${CONTAINER_ID} dmesg | grep -i gvisor } ``` + +### Set up the Kubernetes Runtime Class + +1. Install the Runtime Class for gVisor + +[embedmd]:# (../test/e2e/runtimeclass-install.sh shell /{ # Step 1/ /^}/) +```shell +{ # Step 1: Install a RuntimeClass +cat <<EOF | kubectl apply -f - +apiVersion: node.k8s.io/v1beta1 +kind: RuntimeClass +metadata: + name: gvisor +handler: runsc +EOF +} +``` + +2. Create a Pod with the gVisor Runtime Class + +[embedmd]:# (../test/e2e/runtimeclass-install.sh shell /{ # Step 2/ /^}/) +```shell +{ # Step 2: Create a pod +cat <<EOF | kubectl apply -f - +apiVersion: v1 +kind: Pod +metadata: + name: nginx-gvisor +spec: + runtimeClassName: gvisor + containers: + - name: nginx + image: nginx +EOF +} +``` + +3. Verify that the Pod is running + +[embedmd]:# (../test/e2e/runtimeclass-install.sh shell /{ # Step 3/ /^}/) +```shell +{ # Step 3: Get the pod +kubectl get pod nginx-gvisor -o wide +} +``` diff --git a/docs/runtime-handler-shim-v2-quickstart.md b/docs/runtime-handler-shim-v2-quickstart.md index f5253074d..ca8336089 100644 --- a/docs/runtime-handler-shim-v2-quickstart.md +++ b/docs/runtime-handler-shim-v2-quickstart.md @@ -185,3 +185,48 @@ sudo crictl inspect ${CONTAINER_ID} sudo crictl exec ${CONTAINER_ID} dmesg | grep -i gvisor } ``` + +### Set up the Kubernetes Runtime Class + +1. Install the Runtime Class for gVisor + +[embedmd]:# (../test/e2e/runtimeclass-install.sh shell /{ # Step 1/ /^}/) +```shell +{ # Step 1: Install a RuntimeClass +cat <<EOF | kubectl apply -f - +apiVersion: node.k8s.io/v1beta1 +kind: RuntimeClass +metadata: + name: gvisor +handler: runsc +EOF +} +``` + +2. Create a Pod with the gVisor Runtime Class + +[embedmd]:# (../test/e2e/runtimeclass-install.sh shell /{ # Step 2/ /^}/) +```shell +{ # Step 2: Create a pod +cat <<EOF | kubectl apply -f - +apiVersion: v1 +kind: Pod +metadata: + name: nginx-gvisor +spec: + runtimeClassName: gvisor + containers: + - name: nginx + image: nginx +EOF +} +``` + +3. Verify that the Pod is running + +[embedmd]:# (../test/e2e/runtimeclass-install.sh shell /{ # Step 3/ /^}/) +```shell +{ # Step 3: Get the pod +kubectl get pod nginx-gvisor -o wide +} +``` |