Skip to content

Commit b55836e

Browse files
committed
BZ2187603: SCC and SA for DPDK checkup
Signed-off-by: Avital Pinnick <[email protected]>
1 parent 53aa633 commit b55836e

File tree

3 files changed

+98
-26
lines changed

3 files changed

+98
-26
lines changed

modules/virt-checking-cluster-dpdk-readiness.adoc

Lines changed: 77 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,30 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-checking-cluster-dpdk-readiness_{context}"]
7-
= Checking cluster readiness to run DPDK applications with zero packet loss
7+
= DPDK checkup
88

9-
Use a predefined checkup to verify if your {product-title} cluster node can run a virtual machine (VM) with a Data Plane Development Kit (DPDK) workload. The checkup runs traffic between a traffic generator pod and a VM running a test DPDK application, and checks for packet loss.
9+
Use a predefined checkup to verify that your {product-title} cluster node can run a virtual machine (VM) with a Data Plane Development Kit (DPDK) workload with zero packet loss. The DPDK checkup runs traffic between a traffic generator pod and a VM running a test DPDK application.
10+
11+
You run a DPDK checkup by performing the following steps:
12+
13+
. Create a service account, role, and role bindings for the DPDK checkup and a service account for the traffic generator pod.
14+
. Create a security context constraints resource for the traffic generator pod.
15+
. Create a config map to provide the input to run the checkup and to store the results.
16+
. Create a job to run the checkup.
17+
. Review the results in the config map.
18+
. Optional: To rerun the checkup, delete the existing config map and job and then create a new config map and job.
19+
. When you are finished, delete the DPDK checkup resources.
1020

1121
.Prerequisites
1222
* You have access to the cluster as a user with `cluster-admin` permissions.
1323
* You have installed the OpenShift CLI (`oc`).
1424
* You have configured the compute nodes to run DPDK applications on VMs with zero packet loss.
1525
1626
.Procedure
17-
. Create a manifest file that contains the `ServiceAccount`, `Role`, and `RoleBinding` objects with permissions that the checkup requires for cluster access:
27+
28+
. Create a `ServiceAccount`, `Role`, and `RoleBinding` manifest for the DPDK checkup and the traffic generator pod:
1829
+
19-
.Example roles manifest
30+
.Example service account, role, and rolebinding manifest file
2031
[%collapsible]
2132
====
2233
[source,yaml]
@@ -80,17 +91,71 @@ roleRef:
8091
apiGroup: rbac.authorization.k8s.io
8192
kind: Role
8293
name: kubevirt-dpdk-checker
94+
---
95+
apiVersion: v1
96+
kind: ServiceAccount
97+
metadata:
98+
name: dpdk-checkup-traffic-gen-sa
8399
----
84100
====
85101
86-
. Apply the checkup roles manifest:
102+
. Apply the `ServiceAccount`, `Role`, and `RoleBinding` manifest:
103+
+
104+
[source,terminal]
105+
----
106+
$ oc apply -n <target_namespace> -f <dpdk_sa_roles_rolebinding>.yaml
107+
----
108+
109+
. Create a `SecurityContextConstraints` manifest for the traffic generator pod:
110+
+
111+
.Example security context constraints manifest
112+
[source,yaml]
113+
----
114+
apiVersion: security.openshift.io/v1
115+
kind: SecurityContextConstraints
116+
metadata:
117+
name: dpdk-checkup-traffic-gen
118+
allowHostDirVolumePlugin: true
119+
allowHostIPC: false
120+
allowHostNetwork: false
121+
allowHostPID: false
122+
allowHostPorts: false
123+
allowPrivilegeEscalation: false
124+
allowPrivilegedContainer: false
125+
allowedCapabilities:
126+
- IPC_LOCK
127+
- NET_ADMIN
128+
- NET_RAW
129+
- SYS_RESOURCE
130+
defaultAddCapabilities: null
131+
fsGroup:
132+
type: RunAsAny
133+
groups: []
134+
readOnlyRootFilesystem: false
135+
requiredDropCapabilities: null
136+
runAsUser:
137+
type: RunAsAny
138+
seLinuxContext:
139+
type: RunAsAny
140+
seccompProfiles:
141+
- runtime/default
142+
- unconfined
143+
supplementalGroups:
144+
type: RunAsAny
145+
users:
146+
- system:serviceaccount:dpdk-checkup-ns:dpdk-checkup-traffic-gen-sa
147+
volumes:
148+
- hostPath
149+
----
150+
151+
. Apply the `SecurityContextConstraints` manifest:
87152
+
88153
[source,terminal]
89154
----
90-
$ oc apply -n <target_namespace> -f <dpdk_roles>.yaml
155+
$ oc apply -f <dpdk_scc>.yaml
91156
----
92157
93-
. Create a `ConfigMap` manifest that contains the input parameters for the checkup. The config map also stores the results of the checkup.
158+
. Create a `ConfigMap` manifest that contains the input parameters for the checkup:
94159
+
95160
.Example input config map
96161
[source,yaml]
@@ -111,14 +176,14 @@ data:
111176
<3> The container image for the traffic generator. In this example, the image is pulled from the upstream Project Quay Container Registry.
112177
<4> The container disk image for the VM. In this example, the image is pulled from the upstream Project Quay Container Registry.
113178
114-
. Apply the config map manifest in the target namespace:
179+
. Apply the `ConfigMap` manifest in the target namespace:
115180
+
116181
[source,terminal]
117182
----
118183
$ oc apply -n <target_namespace> -f <dpdk_config_map>.yaml
119184
----
120185
121-
. Create a `Job` object to run the checkup:
186+
. Create a `Job` manifest to run the checkup:
122187
+
123188
.Example job manifest
124189
[source,yaml]
@@ -198,7 +263,7 @@ data:
198263
status.result.dropRate: 0
199264
----
200265
201-
. Delete the job and config map resources that you previously created by running the following commands:
266+
. Delete the job and config map that you previously created by running the following commands:
202267
+
203268
[source,terminal]
204269
----
@@ -210,9 +275,9 @@ $ oc delete job -n <target_namespace> dpdk-checkup
210275
$ oc delete config-map -n <target_namespace> dpdk-checkup-config
211276
----
212277
213-
. Optional: If you do not plan to run another checkup, delete the checkup roles manifest:
278+
. Optional: If you do not plan to run another checkup, delete the `ServiceAccount`, `Role`, and `RoleBinding` manifest:
214279
+
215280
[source,terminal]
216281
----
217-
$ oc delete -f <file_name>.yaml
282+
$ oc delete -f <dpdk_sa_roles_rolebinding>.yaml
218283
----

modules/virt-measuring-latency-vm-secondary-network.adoc

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-measuring-latency-vm-secondary-network_{context}"]
7-
= Checking network connectivity and latency for virtual machines on a secondary network
7+
= Virtual machine latency checkup
88

9-
You use a predefined checkup to verify network connectivity and measure latency between two virtual machines (VMs) that are attached to a secondary network interface.
9+
You use a predefined checkup to verify network connectivity and measure latency between two virtual machines (VMs) that are attached to a secondary network interface. The latency checkup uses the ping utility.
1010

11-
To run a checkup for the first time, follow the steps in the procedure.
11+
You run a latency checkup by performing the following steps:
1212

13-
If you have previously run a checkup, skip to step 5 of the procedure because the steps to install the framework and enable permissions for the checkup are not required.
13+
. Create a service account, roles, and rolebindings to provide cluster access permissions to the latency checkup.
14+
. Create a config map to provide the input to run the checkup and to store the results.
15+
. Create a job to run the checkup.
16+
. Review the results in the config map.
17+
. Optional: To rerun the checkup, delete the existing config map and job and then create a new config map and job.
18+
. When you are finished, delete the latency checkup resources.
1419

1520
.Prerequisites
1621

@@ -21,7 +26,7 @@ If you have previously run a checkup, skip to step 5 of the procedure because th
2126
2227
.Procedure
2328

24-
. Create a manifest file that contains the `ServiceAccount`, `Role`, and `RoleBinding` objects with permissions that the checkup requires for cluster access:
29+
. Create a `ServiceAccount`, `Role`, and `RoleBinding` manifest for the latency checkup:
2530
+
2631
.Example role manifest file
2732
[%collapsible]
@@ -84,15 +89,15 @@ roleRef:
8489
----
8590
====
8691
87-
. Apply the checkup roles manifest:
92+
. Apply the `ServiceAccount`, `Role`, and `RoleBinding` manifest:
8893
+
8994
[source,terminal]
9095
----
91-
$ oc apply -n <target_namespace> -f <latency_roles>.yaml <1>
96+
$ oc apply -n <target_namespace> -f <latency_sa_roles_rolebinding>.yaml <1>
9297
----
9398
<1> `<target_namespace>` is the namespace where the checkup is to be run. This must be an existing namespace where the `NetworkAttachmentDefinition` object resides.
9499
95-
. Create a `ConfigMap` manifest that contains the input parameters for the checkup. The config map provides the input for the framework to run the checkup and also stores the results of the checkup.
100+
. Create a `ConfigMap` manifest that contains the input parameters for the checkup:
96101
+
97102
.Example input config map
98103
[source,yaml]
@@ -123,7 +128,7 @@ data:
123128
$ oc apply -n <target_namespace> -f <latency_config_map>.yaml
124129
----
125130
126-
. Create a `Job` object to run the checkup:
131+
. Create a `Job` manifest to run the checkup:
127132
+
128133
.Example job manifest
129134
[source,yaml]
@@ -155,7 +160,7 @@ spec:
155160
value: kubevirt-vm-latency-checkup-config
156161
----
157162
158-
. Apply the `Job` manifest. The checkup uses the ping utility to verify connectivity and measure latency.
163+
. Apply the `Job` manifest:
159164
+
160165
[source,terminal]
161166
----
@@ -212,7 +217,7 @@ data:
212217
$ oc logs job.batch/kubevirt-vm-latency-checkup -n <target_namespace>
213218
----
214219
215-
. Delete the job and config map resources that you previously created by running the following commands:
220+
. Delete the job and config map that you previously created by running the following commands:
216221
+
217222
[source,terminal]
218223
----
@@ -224,9 +229,9 @@ $ oc delete job -n <target_namespace> kubevirt-vm-latency-checkup
224229
$ oc delete config-map -n <target_namespace> kubevirt-vm-latency-checkup-config
225230
----
226231
227-
. Optional: If you do not plan to run another checkup, delete the checkup role and framework manifest files.
232+
. Optional: If you do not plan to run another checkup, delete the roles manifest:
228233
+
229234
[source,terminal]
230235
----
231-
$ oc delete -f <file_name>.yaml
236+
$ oc delete -f <latency_sa_roles_rolebinding>.yaml
232237
----

virt/support/monitoring/virt-monitoring-overview.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ toc::[]
99
You can monitor the health of your cluster and virtual machines (VMs) with the following tools:
1010

1111
xref:../../../virt/support/monitoring/virt-running-cluster-checkups.adoc#virt-running-cluster-checkups[{product-title} cluster checkup framework]::
12-
Check network connectivity and latency by using predefined, automated tests.
12+
Run automated tests on your cluster with the {product-title} cluster checkup framework to check the following conditions:
13+
* Network connectivity and latency between two VMs attached to a secondary network interface
14+
* VM running a Data Plane Development Kit (DPDK) workload with zero packet loss
1315

1416
:FeatureName: The {product-title} cluster checkup framework
1517
include::snippets/technology-preview.adoc[]

0 commit comments

Comments
 (0)