Skip to content

Commit 7e4093c

Browse files
authored
Merge pull request #75781 from dfitzmau/OSDOCS-10427
OSDOCS-10427: Created an NMState OP section for stat reporting
2 parents c150492 + 056a01f commit 7e4093c

File tree

3 files changed

+110
-1
lines changed

3 files changed

+110
-1
lines changed

modules/k8s-nmstate-installing-the-kubernetes-nmstate-operator.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ The name restriction is a known issue. The instance is a singleton for the entir
4040

4141
.Summary
4242

43-
Once complete, the Operator has deployed the NMState State Controller as a daemon set across all of the cluster nodes.
43+
After you install the Kubernetes NMState Operator, the Operator has deployed the NMState State Controller as a daemon set across all of the cluster nodes.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// This is included in the following assemblies:
2+
//
3+
// networking/k8s_nmstate/k8s-nmstate-about-the-k8s-nmstate-operator.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="viewing-stats-collected-kubernetes-nmtate-op_{context}"]
7+
= Viewing metrics collected by the Kubernetes NMState Operator
8+
9+
The Kubernetes NMState Operator, `kubernetes-nmstate-operator`, can collect metrics from the `kubernetes_nmstate_features_applied` component and expose them as ready-to-use metrics. As a use case for viewing metrics, consider a situation where you created a `NodeNetworkConfigurationPolicy` custom resource and you want to confirm that the policy is active.
10+
11+
[NOTE]
12+
====
13+
The `kubernetes_nmstate_features_applied` metrics are not an API and might change between {product-title} versions.
14+
====
15+
16+
In the *Developer* and *Administrator* perspectives, the Metrics UI includes some predefined CPU, memory, bandwidth, and network packet queries for the selected project. You can run custom Prometheus Query Language (PromQL) queries for CPU, memory, bandwidth, network packet and application metrics for the project.
17+
18+
The following example demonstrates a `NodeNetworkConfigurationPolicy` manifest example that is applied to an {product-title} cluster:
19+
20+
[source,yaml]
21+
----
22+
# ...
23+
interfaces:
24+
- name: br1
25+
type: linux-bridge
26+
state: up
27+
ipv4:
28+
enabled: true
29+
dhcp: true
30+
dhcp-custom-hostname: foo
31+
bridge:
32+
options:
33+
stp:
34+
enabled: false
35+
port: []
36+
# ...
37+
----
38+
39+
The `NodeNetworkConfigurationPolicy` manifest exposes metrics and makes them available to the Cluster Monitoring Operator (CMO). The following example shows some exposed metrics:
40+
41+
[source,terminal]
42+
----
43+
controller_runtime_reconcile_time_seconds_bucket{controller="nodenetworkconfigurationenactment",le="0.005"} 16
44+
controller_runtime_reconcile_time_seconds_bucket{controller="nodenetworkconfigurationenactment",le="0.01"} 16
45+
controller_runtime_reconcile_time_seconds_bucket{controller="nodenetworkconfigurationenactment",le="0.025"} 16
46+
...
47+
# HELP kubernetes_nmstate_features_applied Number of nmstate features applied labeled by its name
48+
# TYPE kubernetes_nmstate_features_applied gauge
49+
kubernetes_nmstate_features_applied{name="dhcpv4-custom-hostname"} 1
50+
----
51+
52+
.Prerequisites
53+
54+
* You have installed the {oc-first}.
55+
* You have logged in to the web console as the administrator and installed the Kubernetes NMState Operator.
56+
* You have access to the cluster as a developer or as a user with view permissions for the project that you are viewing metrics for.
57+
* You have enabled monitoring for user-defined projects.
58+
* You have deployed a service in a user-defined project.
59+
* You have created a `NodeNetworkConfigurationPolicy` manifest and applied it to your cluster.
60+
61+
.Procedure
62+
63+
. If you want to view the metrics from the *Developer* perspective in the {product-title} web console, complete the following tasks:
64+
+
65+
.. Click *Observe*.
66+
+
67+
.. To view the metrics of a specific project, select the project in the *Project:* list. For example, `openshift-nmstate`.
68+
+
69+
.. Click the *Metrics* tab.
70+
+
71+
.. To visualize the metrics on the plot, select a query from the *Select query* list or create a custom PromQL query based on the selected query by selecting *Show PromQL*.
72+
+
73+
[NOTE]
74+
====
75+
In the *Developer* perspective, you can only run one query at a time.
76+
====
77+
78+
. If you want to view the metrics from the *Administrator* perspective in the {product-title} web console, complete the following tasks:
79+
+
80+
.. Click *Observe* -> *Metrics*.
81+
+
82+
.. Enter `kubernetes_nmstate_features_applied` in the *Expression* field.
83+
+
84+
.. Click *Add query* and then *Run queries*.
85+
86+
. To explore the visualized metrics, do any of the following tasks:
87+
+
88+
.. To zoom into the plot and change the time range, do any of the following tasks:
89+
+
90+
** To visually select the time range, click and drag on the plot horizontally.
91+
** To select the time range, use the menu which is in the upper left of the console.
92+
+
93+
.. To reset the time range, select *Reset zoom*.
94+
+
95+
.. To display the output for all the queries at a specific point in time, hold the mouse cursor on the plot at that point. The query output displays in a pop-up box.

networking/k8s_nmstate/k8s-nmstate-about-the-k8s-nmstate-operator.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,19 @@ Node networking is monitored and updated by the following objects:
3838

3939
You can install the Kubernetes NMState Operator by using the web console or the CLI.
4040

41+
// Installing the Kubernetes NMState Operator by using the web console
4142
include::modules/k8s-nmstate-installing-the-kubernetes-nmstate-operator.adoc[leveloffset=+2]
43+
44+
// Installing the Kubernetes NMState Operator using the CLI
4245
include::modules/k8s-nmstate-deploying-nmstate-CLI.adoc[leveloffset=+2]
46+
47+
// Viewing statistics collected by the Kubernetes NMState Operator
48+
include::modules/viewing-stats-collected-kubernetes-nmtate-op.adoc[leveloffset=+2]
49+
50+
[role="_additional-resources"]
51+
[id="additional-resources_k8s-nmstate-view-stats_{context}"]
52+
== Additional resources
53+
54+
* xref:../../networking/k8s_nmstate/k8s-nmstate-about-the-k8s-nmstate-operator.adoc#installing-the-kubernetes-nmstate-operator-cli[Installing the Kubernetes NMState Operator]
55+
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-creating-interface-on-nodes_k8s_nmstate-updating-node-network-config[Creating an interface on nodes]
56+

0 commit comments

Comments
 (0)