From 0bf070c33bceefe82805e0eb146073e53519df7e Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Fri, 13 May 2022 23:15:18 -0700 Subject: [PATCH] doc: write how to use kata-container for pods (#8817) kata-container is not used by default even if enabling kata_containers_enabled. This updates the doc for writing how to do that. --- docs/kata-containers.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/kata-containers.md b/docs/kata-containers.md index 9e7d6c469..30843fd7f 100644 --- a/docs/kata-containers.md +++ b/docs/kata-containers.md @@ -8,7 +8,7 @@ _Qemu_ is the only hypervisor supported by Kubespray. ## Installation -To use Kata Containers, set the following variables: +To enable Kata Containers, set the following variables: **k8s-cluster.yml**: @@ -23,6 +23,31 @@ kata_containers_enabled: true etcd_deployment_type: host ``` +## Usage + +By default, runc is used for pods. +Kubespray generates the runtimeClass kata-qemu, and it is necessary to specify it as +the runtimeClassName of a pod spec to use Kata Containers: + +```shell +$ kubectl get runtimeclass +NAME HANDLER AGE +kata-qemu kata-qemu 3m34s +$ +$ cat nginx.yaml +apiVersion: v1 +kind: Pod +metadata: + name: mypod +spec: + runtimeClassName: kata-qemu + containers: + - name: nginx + image: nginx:1.14.2 +$ +$ kubectl apply -f nginx.yaml +``` + ## Configuration ### Recommended : Pod Overhead