Skip to content

Commit 1a955e1

Browse files
committed
TELCODOCS-2216: Enabling SR-IOV metrics backport
1 parent ee8e3cb commit 1a955e1

File tree

5 files changed

+127
-2
lines changed

5 files changed

+127
-2
lines changed

modules/nw-sriov-configuring-operator.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ spec:
2222
enableInjector: true
2323
enableOperatorWebhook: true
2424
logLevel: 2
25+
featureGates:
26+
metricsExporter: false
2527
----
2628
+
2729
[NOTE]
@@ -86,6 +88,14 @@ By default, this field is set to `true`.
8688
Set to `0` to show only the basic logs. Set to `2` to show all the available logs.
8789
By default, this field is set to `2`.
8890

91+
|`spec.featureGates`
92+
|`map[string]bool`
93+
|Specifies whether to enable or disable the optional features. For example, `metricsExporter`.
94+
95+
|`spec.featureGates.metricsExporter`
96+
|`boolean`
97+
|Specifies whether to enable or disable the SR-IOV Network Operator metrics. By default, this field is set to `false`.
98+
8999
|====
90100

91101
[id="about-network-resource-injector_{context}"]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/hardware_networks/configuring-sriov-operator.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="sriov-network-metrics-exporter_{context}"]
7+
= About the SR-IOV network metrics exporter
8+
9+
The Single Root I/O Virtualization (SR-IOV) network metrics exporter reads the metrics for SR-IOV virtual functions (VFs) and exposes these VF metrics in Prometheus format. When the SR-IOV network metrics exporter is enabled, you can query the SR-IOV VF metrics by using the {product-title} web console to monitor the networking activity of the SR-IOV pods.
10+
11+
When you query the SR-IOV VF metrics by using the web console, the SR-IOV network metrics exporter fetches and returns the VF network statistics along with the name and namespace of the pod that the VF is attached to.
12+
13+
The SR-IOV VF metrics that the metrics exporter reads and exposes in Prometheus format are described in the following table:
14+
15+
.SR-IOV VF metrics
16+
[%autowidth,options="header"]
17+
|====
18+
|Metric| Description |Example PromQL query to examine the VF metric
19+
20+
|`sriov_vf_rx_bytes` |Received bytes per virtual function. |`sriov_vf_rx_bytes * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
21+
|`sriov_vf_tx_bytes` |Transmitted bytes per virtual function. |`sriov_vf_tx_bytes * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
22+
|`sriov_vf_rx_packets` |Received packets per virtual function. |`sriov_vf_rx_packets * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
23+
|`sriov_vf_tx_packets` |Transmitted packets per virtual function. |`sriov_vf_tx_packets * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
24+
|`sriov_vf_rx_dropped` |Dropped packets upon receipt per virtual function. |`sriov_vf_rx_dropped * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
25+
|`sriov_vf_tx_dropped` |Dropped packets during transmission per virtual function. |`sriov_vf_tx_dropped * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
26+
|`sriov_vf_rx_multicast` |Received multicast packets per virtual function. |`sriov_vf_rx_multicast * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
27+
|`sriov_vf_rx_broadcast` |Received broadcast packets per virtual function. |`sriov_vf_rx_broadcast * on (pciAddr,node) group_left(pod,namespace,dev_type) sriov_kubepoddevice`
28+
|`sriov_kubepoddevice` |Virtual functions linked to active pods. |-
29+
30+
|====
31+
32+
You can also combine these queries with the kube-state-metrics to get more information about the SR-IOV pods. For example, you can use the following query to get the VF network statistics along with the application name from the standard Kubernetes pod label:
33+
34+
[source,terminal]
35+
----
36+
(sriov_vf_tx_packets * on (pciAddr,node) group_left(pod,namespace) sriov_kubepoddevice) * on (pod,namespace) group_left (label_app_kubernetes_io_name) kube_pod_labels
37+
----

modules/sriov-operator-metrics.adoc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/hardware_networks/configuring-sriov-operator.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="sriov-operator-metrics_{context}"]
7+
= Enabling the SR-IOV network metrics exporter
8+
9+
The Single Root I/O Virtualization (SR-IOV) network metrics exporter is disabled by default. To enable the metrics exporter, you must set the `spec.featureGates.metricsExporter` field to `true`.
10+
11+
[IMPORTANT]
12+
====
13+
When the metrics exporter is enabled, the SR-IOV Network Operator deploys the metrics exporter only on nodes with SR-IOV capabilities.
14+
====
15+
16+
.Prerequisites
17+
18+
* You have installed the {oc-first}.
19+
* You have logged in as a user with `cluster-admin` privileges.
20+
* You have installed the SR-IOV Network Operator.
21+
22+
.Procedure
23+
24+
. Enable cluster monitoring by running the following command:
25+
+
26+
[source,terminal]
27+
----
28+
$ oc label ns/openshift-sriov-network-operator openshift.io/cluster-monitoring=true
29+
----
30+
+
31+
To enable cluster monitoring, you must add the `openshift.io/cluster-monitoring=true` label in the namespace where you have installed the SR-IOV Network Operator.
32+
33+
. Set the `spec.featureGates.metricsExporter` field to `true` by running the following command:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc patch -n openshift-sriov-network-operator sriovoperatorconfig/default \
38+
--type='merge' -p='{"spec": {"featureGates": {"metricsExporter": true}}}'
39+
----
40+
41+
.Verification
42+
43+
. Check that the SR-IOV network metrics exporter is enabled by running the following command:
44+
+
45+
[source,terminal]
46+
----
47+
$ oc get pods -n openshift-sriov-network-operator
48+
----
49+
+
50+
.Example output
51+
[source,terminal]
52+
----
53+
NAME READY STATUS RESTARTS AGE
54+
operator-webhook-hzfg4 1/1 Running 0 5d22h
55+
sriov-network-config-daemon-tr54m 1/1 Running 0 5d22h
56+
sriov-network-metrics-exporter-z5d7t 1/1 Running 0 10s
57+
sriov-network-operator-cc6fd88bc-9bsmt 1/1 Running 0 5d22h
58+
----
59+
+
60+
The `sriov-network-metrics-exporter` pod must be in the `READY` state.
61+
62+
. Optional: Examine the SR-IOV virtual function (VF) metrics by using the {product-title} web console. For more information, see "Querying metrics".

networking/networking_operators/sr-iov-operator/configuring-sriov-operator.adoc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,18 @@ include::modules/nw-sriov-configuring-operator.adoc[leveloffset=+1]
1212

1313
include::modules/sriov-operator-hosted-control-planes.adoc[leveloffset=+2]
1414

15+
include::modules/sriov-network-metrics-exporter.adoc[leveloffset=+1]
16+
17+
include::modules/sriov-operator-metrics.adoc[leveloffset=+2]
18+
19+
[role="_additional-resources"]
20+
.Additional resources
21+
22+
* xref:../../../observability/monitoring/accessing-metrics/accessing-metrics-as-an-administrator.adoc#querying-metrics-for-all-projects-with-mon-dashboard_accessing-metrics-as-an-administrator[Querying metrics for all projects with the monitoring dashboard]
23+
* xref:../../../observability/monitoring/accessing-metrics/accessing-metrics-as-a-developer.adoc#querying-metrics-for-user-defined-projects-with-mon-dashboard_accessing-metrics-as-a-developer[Querying metrics for user-defined projects as a developer]
24+
1525
[id="configuring-sriov-operator-next-steps"]
1626
== Next steps
1727

1828
* xref:../../../networking/hardware_networks/configuring-sriov-device.adoc#configuring-sriov-device[Configuring an SR-IOV network device]
19-
* Optional: xref:../../../networking/networking_operators/sr-iov-operator/uninstalling-sriov-operator.adoc#uninstalling-sriov-operator[Uninstalling the SR-IOV Network Operator]
20-
29+
* Optional: xref:../../../networking/networking_operators/sr-iov-operator/uninstalling-sriov-operator.adoc#uninstalling-sriov-operator[Uninstalling the SR-IOV Network Operator]

release_notes/ocp-4-16-release-notes.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,13 @@ For more information, see xref:../post_installation_configuration/changing-cloud
699699
[id="ocp-4-16-networking_{context}"]
700700
=== Networking
701701

702+
[id="ocp-4-16-sr-iov-network-metrics-exporter_{context}"]
703+
==== Enabling the SR-IOV network metrics exporter
704+
705+
Starting in 4.16.38, you can query the Single Root I/O Virtualization (SR-IOV) virtual function (VF) metrics by using the {product-title} web console to monitor the networking activity of the SR-IOV pods. When you query the SR-IOV VF metrics by using the web console, the SR-IOV network metrics exporter fetches and returns the VF network statistics along with the name and namespace of the pod that the VF is attached to.
706+
707+
For more information, see xref:../networking/networking_operators/sr-iov-operator/configuring-sriov-operator.adoc#sriov-operator-metrics_configuring-sriov-operator[Enabling the SR-IOV network metrics exporter].
708+
702709
[id="ocp-4-16-networking-openshift-sdn-upgrade-block_{context}"]
703710
==== OpenShift SDN network plugin blocks future major upgrades
704711

0 commit comments

Comments
 (0)