Skip to content

Commit 7e6ae25

Browse files
author
Shikha Jhala
committed
CNV-20429: Updated latency check documentation
1 parent 874767b commit 7e6ae25

File tree

1 file changed

+93
-59
lines changed

1 file changed

+93
-59
lines changed

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

Lines changed: 93 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -54,38 +54,16 @@ rules:
5454
- create
5555
- update
5656
- patch
57-
- apiGroups: [ "" ]
58-
resources: [ "namespaces" ]
59-
verbs:
60-
- get
61-
- list
62-
- create
6357
- delete
64-
- watch
65-
- apiGroups: [ "" ]
66-
resources: [ "serviceaccounts" ]
67-
verbs:
68-
- get
69-
- list
70-
- create
7158
- apiGroups: [ "rbac.authorization.k8s.io" ]
7259
resources:
7360
- roles
7461
- rolebindings
75-
- clusterrolebindings
7662
verbs:
7763
- get
7864
- list
7965
- create
8066
- delete
81-
- apiGroups: [ "rbac.authorization.k8s.io" ]
82-
resources:
83-
- clusterroles
84-
verbs:
85-
- get
86-
- list
87-
- create
88-
- bind
8967
- apiGroups: [ "batch" ]
9068
resources: [ "jobs" ]
9169
verbs:
@@ -118,15 +96,25 @@ subjects:
11896
$ oc apply -f <framework_manifest>.yaml
11997
----
12098
121-
. Create a configuration file that contains the `ClusterRole` and `Role` objects with permissions that the checkup requires for cluster access:
99+
. Create a manifest file that contains the `ServiceAccount`, `Role`, and `RoleBinding` objects with permissions that the checkup requires for cluster access:
122100
+
123-
.Example cluster role manifest file
101+
.Example role manifest file
102+
[%collapsible]
103+
====
124104
[source,yaml]
125105
----
106+
---
107+
apiVersion: v1
108+
kind: ServiceAccount
109+
metadata:
110+
name: vm-latency-checkup-sa
111+
namespace: <target_namespace> <1>
112+
---
126113
apiVersion: rbac.authorization.k8s.io/v1
127-
kind: ClusterRole
114+
kind: Role
128115
metadata:
129116
name: kubevirt-vm-latency-checker
117+
namespace: <target_namespace>
130118
rules:
131119
- apiGroups: ["kubevirt.io"]
132120
resources: ["virtualmachineinstances"]
@@ -137,7 +125,22 @@ rules:
137125
- apiGroups: ["k8s.cni.cncf.io"]
138126
resources: ["network-attachment-definitions"]
139127
verbs: ["get"]
128+
---
129+
apiVersion: rbac.authorization.k8s.io/v1
130+
kind: RoleBinding
131+
metadata:
132+
name: kubevirt-vm-latency-checker
133+
namespace: <target_namespace>
134+
subjects:
135+
- kind: ServiceAccount
136+
name: vm-latency-checkup-sa
137+
roleRef:
138+
kind: Role
139+
name: kubevirt-vm-latency-checker
140+
apiGroup: rbac.authorization.k8s.io
140141
----
142+
====
143+
<1> Specify the namespace where the checkup is to be executed. This must be an existing namespace where the `NetworkAttachmentDefinition` object resides.
141144
142145
. Apply the checkup roles manifest:
143146
+
@@ -154,24 +157,28 @@ $ oc apply -f <latency_roles>.yaml
154157
apiVersion: v1
155158
kind: ConfigMap
156159
metadata:
157-
name: kubevirt-vm-latency-checkup
158-
namespace: kiagnose
160+
name: kubevirt-vm-latency-checkup-config
161+
namespace: <target_namespace> <1>
159162
data:
160-
spec.image: registry.redhat.io/container-native-virtualization/vm-network-latency-checkup:v4.11.0
161-
spec.timeout: 10m
162-
spec.clusterRoles: |
163-
kubevirt-vmis-manager
164-
spec.param.network_attachment_definition_namespace: "default" <1>
165-
spec.param.network_attachment_definition_name: "bridge-network" <2>
166-
spec.param.max_desired_latency_milliseconds: "10" <3>
167-
spec.param.sample_duration_seconds: "5" <4>
163+
spec.image: registry.redhat.io/container-native-virtualization/vm-network-latency-checkup:v4.12.0
164+
spec.timeout: 5m
165+
spec.serviceAccountName: vm-latency-checkup-sa
166+
spec.param.network_attachment_definition_namespace: <target_namespace> <2>
167+
spec.param.network_attachment_definition_name: "bridge-network" <3>
168+
spec.param.max_desired_latency_milliseconds: "10" <4>
169+
spec.param.sample_duration_seconds: "5" <5>
170+
spec.param.source_node: "worker1" <6>
171+
spec.param.target_node: "worker2" <7>
168172
----
169-
<1> The namespace where the `NetworkAttachmentDefinition` object resides.
170-
<2> The name of the `NetworkAttachmentDefinition` object.
171-
<3> Optional: The maximum desired latency, in milliseconds, between the virtual machines. If the measured latency exceeds this value, the check fails.
172-
<4> Optional: The duration of the latency check, in seconds.
173+
<1> The namespace where the checkup is to be executed. This must be an existing namespace where the `NetworkAttachmentDefinition` object resides.
174+
<2> The namespace where the `NetworkAttachmentDefinition` object resides.
175+
<3> The name of the `NetworkAttachmentDefinition` object.
176+
<4> Optional: The maximum desired latency, in milliseconds, between the virtual machines. If the measured latency exceeds this value, the checkup fails.
177+
<5> Optional: The duration of the latency check, in seconds.
178+
<6> Optional: When specified, latency is measured from this node to the target node. If the source node is specified, the `spec.param.target_node` field cannot be empty.
179+
<7> Optional: When specified, latency is measured from the source node to this node.
173180
174-
. Create the config map in the framework’s namespace:
181+
. Apply the config map manifest in the framework’s namespace:
175182
+
176183
[source,terminal]
177184
----
@@ -196,12 +203,12 @@ spec:
196203
restartPolicy: Never
197204
containers:
198205
- name: framework
199-
image: registry.redhat.io/container-native-virtualization/checkup-framework:v4.11.0
206+
image: registry.redhat.io/container-native-virtualization/checkup-framework:v4.12.0
200207
env:
201208
- name: CONFIGMAP_NAMESPACE
202-
value: kiagnose
209+
value: <target_namespace>
203210
- name: CONFIGMAP_NAME
204-
value: kubevirt-vm-latency-checkup
211+
value: kubevirt-vm-latency-checkup-config
205212
----
206213
207214
. Apply the `Job` manifest. The checkup uses the ping utility to verify connectivity and measure latency.
@@ -215,14 +222,14 @@ $ oc apply -f <latency_job>.yaml
215222
+
216223
[source,terminal]
217224
----
218-
$ oc wait --for=condition=complete --timeout=10m job.batch/kubevirt-vm-latency-checkup -n kiagnose
225+
$ oc wait job kubevirt-vm-latency-checkup -n kiagnose --for condition=complete --timeout 6m
219226
----
220227
221-
. Review the results of the latency checkup by retrieving the status of the `ConfigMap` object. If the measured latency is greater than the value of the `spec.param.max_desired_latency_milliseconds` attribute, the checkup fails and returns an error.
228+
. Review the results of the latency checkup by retrieving the status of the `ConfigMap` object. If the maximum measured latency is greater than the value of the `spec.param.max_desired_latency_milliseconds` attribute, the checkup fails and returns an error.
222229
+
223230
[source,terminal]
224231
----
225-
$ oc get configmap kubevirt-vm-latency-checkup -n kiagnose -o yaml
232+
$ oc get configmap kubevirt-vm-latency-checkup-config -n <target_namespace> -o yaml
226233
----
227234
+
228235
.Example output config map (success)
@@ -231,24 +238,51 @@ $ oc get configmap kubevirt-vm-latency-checkup -n kiagnose -o yaml
231238
apiVersion: v1
232239
kind: ConfigMap
233240
metadata:
234-
name: kubevirt-vm-latency-checkup
235-
namespace: kiagnose
236-
...
241+
name: kubevirt-vm-latency-checkup-config
242+
namespace: <target_namespace>
243+
data:
244+
spec.image: registry.redhat.io/container-native-virtualization/vm-network-latency-checkup:v4.12.0
245+
spec.timeout: 5m
246+
spec.serviceAccountName: vm-latency-checkup-sa
247+
spec.param.network_attachment_definition_namespace: <target_namespace>
248+
spec.param.network_attachment_definition_name: "bridge-network"
249+
spec.param.max_desired_latency_milliseconds: "10"
250+
spec.param.sample_duration_seconds: "5"
251+
spec.param.source_node: "worker1"
252+
spec.param.target_node: "worker2"
237253
status.succeeded: "true"
238254
status.failureReason: ""
239-
status.result.minLatencyNanoSec: 2000
240-
status.result.maxLatencyNanoSec: 3000
241-
status.result.avgLatencyNanoSec: 2500
242-
status.results.measurementDurationSec: 300
243-
...
255+
status.completionTimestamp: "2022-01-01T09:00:00Z"
256+
status.startTimestamp: "2022-01-01T09:00:07Z"
257+
status.result.avgLatencyNanoSec: "177000"
258+
status.result.maxLatencyNanoSec: "244000" <1>
259+
status.result.measurementDurationSec: "5"
260+
status.result.minLatencyNanoSec: "135000"
261+
status.result.sourceNode: "worker1"
262+
status.result.targetNode: "worker2"
244263
----
264+
<1> The maximum measured latency in nanoseconds.
245265
246-
. Delete the framework and checkup resources that you previously created. This includes the job, config map, cluster role, and framework manifest files.
266+
. Optional: To view the detailed job log in case of checkup failure, use the following command:
247267
+
248-
[NOTE]
249-
====
250-
Do not delete the framework and cluster role manifest files if you plan to run another checkup.
251-
====
268+
[source,terminal]
269+
----
270+
$ oc logs job.batch/kubevirt-vm-latency-checkup -n kiagnose
271+
----
272+
273+
. Delete the job and config map resources that you previously created.
274+
+
275+
[source,terminal]
276+
----
277+
$ oc delete job -n kiagnose kubevirt-vm-latency-checkup
278+
----
279+
+
280+
[source,terminal]
281+
----
282+
$ oc delete config-map -n <target_namespace> kubevirt-vm-latency-checkup-config
283+
----
284+
285+
. Optional: If you do not plan to run another checkup, delete the checkup role and framework manifest files.
252286
+
253287
[source,terminal]
254288
----

0 commit comments

Comments
 (0)