Post

RuntimeClass GAdvisor and Kata containers

RuntimeClass GAdvisor and Kata containers

**Prepare runtimeClass yaml specification’’

1
2
3
4
5
6
7
8
9
10
11
12
13
14
k get runtimeclasses.node.k8s.io -A
NAME              HANDLER        AGE
gvisor            runsc          2m58s
kata-containers   kata-runtime   2m57s

vim runtimeclass.yaml
...
apiVersion: node.k8s.io/v1  # RuntimeClass is defined in the node.k8s.io API group
kind: RuntimeClass
metadata:
  name: secure-runtime # The name the RuntimeClass will be referenced by
  # RuntimeClass is a non-namespaced resource
handler: runsc  # The name of the corresponding CRI configuration
:wq!

**Create a custom runtimeClass by using kubectl command’’

1
2
3
4
5
6
7
8
9
10
# apply this file
k create -f  runtimeclass.yaml
runtimeclass.node.k8s.io/secure-runtime created

# check a newly created runtimeClass
k get runtimeclasses.node.k8s.io -A
NAME              HANDLER        AGE
gvisor            runsc          7m25s
kata-containers   kata-runtime   7m24s
secure-runtime    runsc          2m48s

**Create a pod using secure-runtime runtimeClass’’

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# create a pod using secure-runtime runtimeclass
cat simple-webapp-1.yaml
apiVersion: v1
kind: Pod
metadata:
    name: simple-webapp-1
    labels:
        name: simple-webapp
spec:
    runtimeClassName: secure-runtime
    containers:
        -
            name: simple-webapp
            image: kodekloud/webapp-delayed-start
            ports:
                -
                    containerPort: 8080
This post is licensed under CC BY 4.0 by the author.