kata-deploy: fix k8s 1.13 example files

update yaml, and update README to describe creation of the CRD in
Kubernetes versions < 1.14.

Fixes: #560

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
This commit is contained in:
Eric Ernst 2019-06-04 22:18:52 -07:00
parent 47eb1c27d1
commit 305ffdaef9
4 changed files with 47 additions and 12 deletions

View File

@ -81,26 +81,31 @@ $ kubectl apply -f kata-deploy.yaml
Workloads which utilize Kata can node-select based on `katacontainers.io/kata-runtime=true`, and are
run through an applicable runtime if they are marked with the appropriate `runtimeClass` annotation.
`runtimeClass` is a built-in type in Kubernetes versions 1.14 and greater. In Kubernetes 1.13, `runtimeClass`
is defined through a custom resource definition. For Kubernetes 1.13:
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.13/runtimeclass-crd.yaml
```
In order to use a workload Kata with QEMU, first add a `RuntimeClass` as:
- For k8s 1.14:
- For Kubernetes 1.14:
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.14/kata-qemu-runtimeClass.yaml
```
- For k8s 1.13:
- For Kubernetes 1.13:
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.13/kata-qemu-runtimeClass.yaml
```
In order to use a workload Kata with Firecracker, first add a `RuntimeClass` as:
- For k8s 1.14:
- For Kubernetes 1.14:
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.14/kata-fc-runtimeClass.yaml
```
- For k8s 1.13:
- For Kubernetes 1.13:
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/packaging/master/kata-deploy/k8s-1.13/kata-fc-runtimeClass.yaml
```

View File

@ -1,5 +1,7 @@
---
kind: RuntimeClass
apiVersion: node.k8s.io/v1alpha1
metadata:
name: kata-fc
handler: kata-fc
spec:
runtimeHandler: kata-fc

View File

@ -1,12 +1,14 @@
---
kind: RuntimeClass
apiVersion: node.k8s.io/v1alpha1
metadata:
name: kata
handler: kata
---
kind: RuntimeClass
apiVersion: node.k8s.io/v1alpha1
metadata:
name: kata-qemu
handler: kata-qemu
spec:
runtimeHandler: kata-qemu
---
kind: RuntimeClass
apiVersion: node.k8s.io/v1alpha1
metadata:
name: kata
spec:
runtimeHandler: kata

View File

@ -0,0 +1,26 @@
kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1beta1
metadata:
name: runtimeclasses.node.k8s.io
labels:
addonmanager.kubernetes.io/mode: Reconcile
spec:
group: node.k8s.io
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
names:
plural: runtimeclasses
singular: runtimeclass
kind: RuntimeClass
scope: Cluster
validation:
openAPIV3Schema:
properties:
spec:
properties:
runtimeHandler:
type: string
pattern: '^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?$'