Skip to content

Commit 62da25f

Browse files
authored
Merge pull request #42831 from aireilly/td-295
[TELCODOCS-295] - Adding KATA node check feature docs
2 parents 480d1dd + e874cc5 commit 62da25f

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * sandboxed_containers/deploying-sandboxed-container-workloads.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="sandboxed-containers-check-node-eligiblilty_{context}"]
7+
= Checking whether cluster nodes are eligible to run {sandboxed-containers-first}
8+
9+
Before running {sandboxed-containers-first}, you can check whether the nodes in your cluster are eligible to run Kata containers. Some cluster nodes might not comply with sandboxed containers' minimum requirements. The most common reason for node ineligibility is the lack of virtualization support on the node. If you attempt to run sandboxed workloads on ineligible nodes, you will experience errors. You can use the Node Feature Discovery Operator (NFD) and a `NodeFeatureDiscovery` resource to automatically check node eligibility.
10+
11+
[NOTE]
12+
====
13+
If you want to install the Kata runtime on only selected worker nodes that you know are eligible, apply the `feature.node.kubernetes.io/runtime.kata=true` label to the selected nodes and set `checkNodeEligibility: true` in the `KataConfig` resource.
14+
15+
Alternatively, to install the Kata runtime on all worker nodes, set `checkNodeEligibility: false` in the `KataConfig` resource.
16+
17+
In both these scenarios, you do not need to create the `NodeFeatureDiscovery` resource. You should only apply the `feature.node.kubernetes.io/runtime.kata=true` label manually if you are sure that the node is eligible to run Kata containers.
18+
====
19+
20+
The following procedure applies the `feature.node.kubernetes.io/runtime.kata=true` label to all eligible nodes and configures the `KataConfig` resource to check for node eligibility.
21+
22+
.Prerequisites
23+
24+
* Install the OpenShift CLI (`oc`).
25+
* Log in as a user with `cluster-admin` privileges.
26+
* Install the Node Feature Discovery (NFD) Operator.
27+
28+
.Procedure
29+
30+
. Create a `NodeFeatureDiscovery` resource to detect node capabilities suitable for running Kata containers:
31+
32+
.. Save the following YAML in the `nfd.yaml` file:
33+
+
34+
[source,yaml]
35+
----
36+
apiVersion: nfd.openshift.io/v1
37+
kind: NodeFeatureDiscovery
38+
metadata:
39+
name: nfd-kata
40+
namespace: openshift-nfd
41+
spec:
42+
operand:
43+
namespace: openshift-nfd
44+
image: quay.io/openshift/origin-node-feature-discovery:4.10
45+
imagePullPolicy: Always
46+
servicePort: 12000
47+
workerConfig:
48+
configData: |
49+
sources:
50+
custom:
51+
- name: "feature.node.kubernetes.io/runtime.kata"
52+
matchOn:
53+
- cpuId: ["SSE4", "VMX"]
54+
loadedKMod: ["kvm", "kvm_intel"]
55+
- cpuId: ["SSE4", "SVM"]
56+
loadedKMod: ["kvm", "kvm_amd"]
57+
----
58+
59+
.. Create the `NodeFeatureDiscovery` custom resource (CR):
60+
+
61+
[source,terminal]
62+
----
63+
$ oc create -f nfd.yaml
64+
----
65+
+
66+
.Example output
67+
[source,terminal]
68+
----
69+
nodefeaturediscovery.nfd.openshift.io/nfd-kata created
70+
----
71+
+
72+
A `feature.node.kubernetes.io/runtime.kata=true` label is applied to all qualifying worker nodes.
73+
74+
. Set the `checkNodeEligibility` field to `true` in the `KataConfig` resource to enable the feature, for example:
75+
76+
.. Save the following YAML in the `kata-config.yaml` file:
77+
+
78+
[source,yaml]
79+
----
80+
apiVersion: kataconfiguration.openshift.io/v1
81+
kind: KataConfig
82+
metadata:
83+
name: example-kataconfig
84+
spec:
85+
checkNodeEligibility: true
86+
----
87+
88+
.. Create the `KataConfig` CR:
89+
+
90+
[source,terminal]
91+
----
92+
$ oc create -f kata-config.yaml
93+
----
94+
+
95+
.Example output
96+
[source,terminal]
97+
----
98+
kataconfig.kataconfiguration.openshift.io/example-kataconfig created
99+
----
100+
101+
.Verification
102+
103+
* Verify that qualifying nodes in the cluster have the correct label applied:
104+
+
105+
[source,terminal]
106+
----
107+
$ oc get nodes --selector='feature.node.kubernetes.io/runtime.kata=true'
108+
----
109+
+
110+
.Example output
111+
[source,terminal]
112+
----
113+
NAME STATUS ROLES AGE VERSION
114+
compute-3.example.com Ready worker 4h38m v1.23.3+e419edf
115+
compute-2.example.com Ready worker 4h35m v1.23.3+e419edf
116+
----

sandboxed_containers/deploying-sandboxed-container-workloads.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ include::modules/sandboxed-containers-preparing-openshift-cluster.adoc[leveloffs
1414
.Additional resources
1515
* xref:../installing/installing_bare_metal/installing-bare-metal.adoc#installing-bare-metal[Installing a user-provisioned cluster on bare metal]
1616
17+
include::modules/sandboxed-containers-check-node-eligiblilty.adoc[leveloffset=+2]
18+
19+
[role="_additional-resources"]
20+
.Additional resources
21+
22+
* For more information about installing the Node Feature Discovery (NFD) Operator, see xref:../hardware_enablement/psap-node-feature-discovery-operator.adoc#installing-the-node-feature-discovery-operator_node-feature-discovery-operator[Installing NFD].
23+
24+
[id="deploying-sandboxed-containers-workloads-web-console"]
1725
== Deploying {sandboxed-containers-first} workloads using the web console
1826

1927
You can deploy {sandboxed-containers-first} workloads from the web console. First, you must install the {sandboxed-containers-operator}, then create the `KataConfig` custom resource (CR). Once you are ready to deploy a workload in a sandboxed container, you must manually add `kata` as the `runtimeClassName` to the workload YAML file.
@@ -23,6 +31,7 @@ include::modules/sandboxed-containers-create-kataconfig-resource-web-console.ado
2331
//include::modules/sandboxed-containers-selecting-nodes-web-console.adoc[leveloffset=+3]
2432
include::modules/sandboxed-containers-deploying-workloads-with-kata-runtime-web.adoc[leveloffset=+2]
2533

34+
[id="deploying-sandboxed-containers-workloads-cli"]
2635
== Deploying {sandboxed-containers-first} workloads using the CLI
2736

2837
You can deploy {sandboxed-containers-first} workloads using the CLI. First, you must install the {sandboxed-containers-operator}, then create the `KataConfig` custom resource. Once you are ready to deploy a workload in a sandboxed container, you must add `kata` as the `runtimeClassName` to the workload YAML file.

0 commit comments

Comments
 (0)