From 39b454045d5fe205736f36b9c6cb940af5bce20b Mon Sep 17 00:00:00 2001 From: Saikrishna Edupuganti Date: Wed, 27 Mar 2019 01:17:16 +0000 Subject: [PATCH] Copied the README too Signed-off-by: Saikrishna Edupuganti --- clr-k8s-examples/admit-kata/README.md | 39 +++++++++++++++++++++++++++ clr-k8s-examples/admit-kata/versions | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 clr-k8s-examples/admit-kata/README.md create mode 100644 clr-k8s-examples/admit-kata/versions diff --git a/clr-k8s-examples/admit-kata/README.md b/clr-k8s-examples/admit-kata/README.md new file mode 100644 index 0000000..36548ac --- /dev/null +++ b/clr-k8s-examples/admit-kata/README.md @@ -0,0 +1,39 @@ +# Kata Admission controller webhook + +Implement a simple admission controller webhook to annotate pods with the +Kata runtime class. + +## How to build the admission controller + +First build the admission controller image and the associated +Kubernetes yaml files required to instantiate the admission +controller. + +```bash +$ docker build -t katadocker/kata-webhook-example:latest . +$ ./create_certs.sh +``` + +> **Note:** +> Image needs to be published for the webhook needs to work. Alternately +> on a single machine cluster change the `imagePullPolicy` to use the locally +> built image. + +## Making Kata the default runtime using an admission controller + +Today in `crio.conf` `runc` is the default runtime when a user does not specify +`runtimeClass` in the pod spec. If you want to run a cluster where Kata is used +by default, except for workloads we know for sure will not work with Kata, use +the [admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks) +and sample admission controller we created by running + +```bash +$ kubectl apply -f deploy/ +``` + +The webhook mutates pods to use the kata runtime class for all pods except +those with + +* `hostNetwork: true` +* namespace: `rook-ceph` and `rook-ceph-system` + diff --git a/clr-k8s-examples/admit-kata/versions b/clr-k8s-examples/admit-kata/versions new file mode 100644 index 0000000..a2102f7 --- /dev/null +++ b/clr-k8s-examples/admit-kata/versions @@ -0,0 +1,2 @@ +https://github.com/kata-containers/tests/tree/master/kata-webhook +Commit: 5ad2cec