@@ -12,46 +12,60 @@ workloads. This could be a
12
12
cluster on Google Cloud Platform or one you have set up yourself using
13
13
[ containerd Quick Start] ( https://gvisor.dev/docs/user_guide/containerd/quick_start/ ) .
14
14
15
- This guide will also assume you have Knative installed using
16
- [ Istio] ( https://istio.io/ ) as the network layer. You can follow the
15
+ Follow the
17
16
[ Knative installation guide] ( https://knative.dev/docs/install/install-serving-with-yaml/ )
18
17
to install Knative.
19
18
20
- ## Enable the RuntimeClass feature flag
19
+ ## Enable the RuntimeClassName deployment config
21
20
22
21
Knative allows the use of various parameters on Pods via
23
- [ feature flags] ( https://knative.dev/docs/serving/feature-flags/ ) . We will enable
24
- the
25
- [ runtimeClassName] ( https://knative.dev/docs/serving/feature-flags/#kubernetes-runtime-class )
26
- feature flag to enable the use of the Kubernetes
27
- [ Runtime Class] ( https://kubernetes.io/docs/concepts/containers/runtime-class/ ) .
22
+ [ deployment configs] ( https://knative.dev/docs/serving/configuration/deployment )
23
+ amongst other things. We will set the
24
+ [ runtime-class-name] ( https://knative.dev/docs/serving/configuration/deployment/#configuring-selectable-runtimeclassname )
25
+ property to configure the Kubernetes deployments created by Knative.
28
26
29
- Edit the feature flags ConfigMap.
27
+ Edit the deployment ConfigMap.
30
28
31
29
``` bash
32
- kubectl edit configmap config-features -n knative-serving
30
+ kubectl edit configmap config-deployment -n knative-serving
33
31
```
34
32
35
- Add the ` kubernetes.podspec-runtimeclassname: enabled ` to the ` data ` field. Once
36
- you are finished the ConfigMap will look something like this (minus all the
37
- system fields).
33
+ Setting the ` runtime-class-name ` configures the Pod field by label selectors.
34
+
35
+ Enforce all Pods run through Knative to use gVisor as the Runtime Class:
36
+
37
+ ``` yaml
38
+ apiVersion : v1
39
+ kind : ConfigMap
40
+ metadata :
41
+ name : config-deployment
42
+ namespace : knative-serving
43
+ data :
44
+ runtime-class-name : |
45
+ gvisor: {}
46
+ ` ` `
47
+
48
+ Allow exception for Pods to run without gVisor as the Runtime Class when a label
49
+ is set:
38
50
39
51
` ` ` yaml
40
52
apiVersion : v1
41
53
kind : ConfigMap
42
54
metadata :
43
- name : config-features
55
+ name : config-deployment
44
56
namespace : knative-serving
45
- labels :
46
- serving.knative.dev/release : v0.22.0
47
57
data :
48
- kubernetes.podspec-runtimeclassname : enabled
58
+ runtime-class-name : |
59
+ "":
60
+ selector:
61
+ no-isolation-here: "true"
62
+ gvisor: {}
49
63
` ` `
50
64
51
65
## Deploy the Service
52
66
53
- After you have set the Runtime Class feature flag you can now create Knative
54
- services that specify a ` runtimeClassName` in the spec .
67
+ After you have set the Runtime Class deployment config you can now create
68
+ Knative Service .
55
69
56
70
` ` ` bash
57
71
cat <<EOF | kubectl apply -f -
@@ -62,7 +76,6 @@ metadata:
62
76
spec :
63
77
template :
64
78
spec :
65
- runtimeClassName: gvisor
66
79
containers :
67
80
- image : gcr.io/knative-samples/helloworld-go
68
81
env :
0 commit comments