From fe597b07f1b401ec5c1c9f405b493ff10df714c1 Mon Sep 17 00:00:00 2001 From: Mihai Idu Date: Tue, 28 Jul 2026 13:54:56 +0200 Subject: [PATCH] MON-4558: add zoneinfo to NodeExporterCollectorConfig CRD types Add NodeExporterCollectorZoneinfoConfig with CollectionPolicy enum to expose per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. Use terminology consistent with Collect/DoNotCollect enum values. --- config/v1alpha1/types_cluster_monitoring.go | 22 +++++++++++++ ...ig-operator_01_clustermonitorings.crd.yaml | 23 +++++++++++++ config/v1alpha1/zz_generated.deepcopy.go | 17 ++++++++++ .../ClusterMonitoringConfig.yaml | 23 +++++++++++++ config/v1alpha1/zz_generated.model_name.go | 5 +++ .../zz_generated.swagger_doc_generated.go | 10 ++++++ .../generated_openapi/zz_generated.openapi.go | 32 ++++++++++++++++++- openapi/openapi.json | 22 +++++++++++++ ...ig-operator_01_clustermonitorings.crd.yaml | 23 +++++++++++++ 9 files changed, 176 insertions(+), 1 deletion(-) diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index 6a6bfcb6979..9748d44cf1f 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -473,6 +473,14 @@ type NodeExporterCollectorConfig struct { // which is subject to change over time. The current default is enabled. // +optional DeviceMapperMultipath NodeExporterCollectorDeviceMapperMultipathConfig `json:"deviceMapperMultipath,omitzero"` + // zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, + // watermarks, and protection thresholds from /proc/zoneinfo. + // zoneinfo is optional. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, + // which is subject to change over time. The current default is to not collect zoneinfo metrics. + // Enable when you need visibility into kernel memory zone allocation and pressure. + // +optional + Zoneinfo NodeExporterCollectorZoneinfoConfig `json:"zoneinfo,omitzero"` } // NodeExporterCollectorCpufreqConfig provides configuration for the cpufreq collector @@ -710,6 +718,20 @@ type NodeExporterCollectorDeviceMapperMultipathConfig struct { CollectionPolicy NodeExporterCollectorCollectionPolicy `json:"collectionPolicy,omitempty"` } +// NodeExporterCollectorZoneinfoConfig provides configuration for the zoneinfo collector +// of the node-exporter agent. The zoneinfo collector exposes per-zone memory page counts, +// watermarks, and protection thresholds from /proc/zoneinfo. +// By default, the zoneinfo collector does not collect metrics. +type NodeExporterCollectorZoneinfoConfig struct { + // collectionPolicy declares whether the zoneinfo collector collects metrics. + // This field is required. + // Valid values are "Collect" and "DoNotCollect". + // When set to "Collect", the zoneinfo collector is active and zone memory statistics are collected. + // When set to "DoNotCollect", the zoneinfo collector is inactive. + // +required + CollectionPolicy NodeExporterCollectorCollectionPolicy `json:"collectionPolicy,omitempty"` +} + // MonitoringPluginConfig provides configuration options for the monitoring plugin // that runs as a dynamic plugin of the OpenShift web console. // The monitoring plugin provides the monitoring UI in the OpenShift web console diff --git a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml index 8a25a8e92a3..bd63fbddfce 100644 --- a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -2458,6 +2458,29 @@ spec: required: - collectionPolicy type: object + zoneinfo: + description: |- + zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, + watermarks, and protection thresholds from /proc/zoneinfo. + zoneinfo is optional. + When omitted, this means no opinion and the platform is left to choose a reasonable default, + which is subject to change over time. The current default is to not collect zoneinfo metrics. + Enable when you need visibility into kernel memory zone allocation and pressure. + properties: + collectionPolicy: + description: |- + collectionPolicy declares whether the zoneinfo collector collects metrics. + This field is required. + Valid values are "Collect" and "DoNotCollect". + When set to "Collect", the zoneinfo collector is active and zone memory statistics are collected. + When set to "DoNotCollect", the zoneinfo collector is inactive. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object type: object ignoredNetworkDevices: description: |- diff --git a/config/v1alpha1/zz_generated.deepcopy.go b/config/v1alpha1/zz_generated.deepcopy.go index 48db2e4e93d..0815e022602 100644 --- a/config/v1alpha1/zz_generated.deepcopy.go +++ b/config/v1alpha1/zz_generated.deepcopy.go @@ -1025,6 +1025,7 @@ func (in *NodeExporterCollectorConfig) DeepCopyInto(out *NodeExporterCollectorCo in.Systemd.DeepCopyInto(&out.Systemd) out.Softirqs = in.Softirqs out.DeviceMapperMultipath = in.DeviceMapperMultipath + out.Zoneinfo = in.Zoneinfo return } @@ -1253,6 +1254,22 @@ func (in *NodeExporterCollectorTcpStatConfig) DeepCopy() *NodeExporterCollectorT return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeExporterCollectorZoneinfoConfig) DeepCopyInto(out *NodeExporterCollectorZoneinfoConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeExporterCollectorZoneinfoConfig. +func (in *NodeExporterCollectorZoneinfoConfig) DeepCopy() *NodeExporterCollectorZoneinfoConfig { + if in == nil { + return nil + } + out := new(NodeExporterCollectorZoneinfoConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeExporterConfig) DeepCopyInto(out *NodeExporterConfig) { *out = *in diff --git a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index d9b2492aab6..e02c0c28c3e 100644 --- a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -2458,6 +2458,29 @@ spec: required: - collectionPolicy type: object + zoneinfo: + description: |- + zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, + watermarks, and protection thresholds from /proc/zoneinfo. + zoneinfo is optional. + When omitted, this means no opinion and the platform is left to choose a reasonable default, + which is subject to change over time. The current default is to not collect zoneinfo metrics. + Enable when you need visibility into kernel memory zone allocation and pressure. + properties: + collectionPolicy: + description: |- + collectionPolicy declares whether the zoneinfo collector collects metrics. + This field is required. + Valid values are "Collect" and "DoNotCollect". + When set to "Collect", the zoneinfo collector is active and zone memory statistics are collected. + When set to "DoNotCollect", the zoneinfo collector is inactive. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object type: object ignoredNetworkDevices: description: |- diff --git a/config/v1alpha1/zz_generated.model_name.go b/config/v1alpha1/zz_generated.model_name.go index 349b7e8ae5f..56960781c5a 100644 --- a/config/v1alpha1/zz_generated.model_name.go +++ b/config/v1alpha1/zz_generated.model_name.go @@ -290,6 +290,11 @@ func (in NodeExporterCollectorTcpStatConfig) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorTcpStatConfig" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeExporterCollectorZoneinfoConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorZoneinfoConfig" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in NodeExporterConfig) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.NodeExporterConfig" diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index b53520e86d5..540484b5b8a 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -357,6 +357,7 @@ var map_NodeExporterCollectorConfig = map[string]string{ "systemd": "systemd configures the systemd collector, which collects statistics on the systemd daemon and its managed services. systemd is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is disabled. Enabling this collector with a long list of selected units may produce metrics with high cardinality. If you enable this collector, closely monitor the prometheus-k8s deployment for excessive memory usage. Enable when you need metrics for specific units; scope units carefully.", "softirqs": "softirqs configures the softirqs collector, which exposes detailed softirq statistics from /proc/softirqs. softirqs is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is disabled. Enable when you need visibility into kernel softirq processing across CPUs.", "deviceMapperMultipath": "deviceMapperMultipath configures the dmmultipath collector, which collects statistics about DM-Multipath devices. deviceMapperMultipath is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is enabled.", + "zoneinfo": "zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. zoneinfo is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is to not collect zoneinfo metrics. Enable when you need visibility into kernel memory zone allocation and pressure.", } func (NodeExporterCollectorConfig) SwaggerDoc() map[string]string { @@ -482,6 +483,15 @@ func (NodeExporterCollectorTcpStatConfig) SwaggerDoc() map[string]string { return map_NodeExporterCollectorTcpStatConfig } +var map_NodeExporterCollectorZoneinfoConfig = map[string]string{ + "": "NodeExporterCollectorZoneinfoConfig provides configuration for the zoneinfo collector of the node-exporter agent. The zoneinfo collector exposes per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. By default, the zoneinfo collector does not collect metrics.", + "collectionPolicy": "collectionPolicy declares whether the zoneinfo collector collects metrics. This field is required. Valid values are \"Collect\" and \"DoNotCollect\". When set to \"Collect\", the zoneinfo collector is active and zone memory statistics are collected. When set to \"DoNotCollect\", the zoneinfo collector is inactive.", +} + +func (NodeExporterCollectorZoneinfoConfig) SwaggerDoc() map[string]string { + return map_NodeExporterCollectorZoneinfoConfig +} + var map_NodeExporterConfig = map[string]string{ "": "NodeExporterConfig provides configuration options for the node-exporter agent that runs as a DaemonSet in the `openshift-monitoring` namespace. The node-exporter agent collects hardware and OS-level metrics from every node in the cluster, including CPU, memory, disk, and network statistics. At least one field must be specified.", "resources": "resources defines the compute resource requests and limits for the node-exporter container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 8m\n limit: null\n - name: memory\n request: 32Mi\n limit: null", diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 65e31f45b76..cfbc8958f64 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -571,6 +571,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA configv1alpha1.NodeExporterCollectorSystemdCollectConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorSystemdCollectConfig(ref), configv1alpha1.NodeExporterCollectorSystemdConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorSystemdConfig(ref), configv1alpha1.NodeExporterCollectorTcpStatConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorTcpStatConfig(ref), + configv1alpha1.NodeExporterCollectorZoneinfoConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorZoneinfoConfig(ref), configv1alpha1.NodeExporterConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterConfig(ref), configv1alpha1.OAuth2{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_OAuth2(ref), configv1alpha1.OAuth2EndpointParam{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_OAuth2EndpointParam(ref), @@ -25250,11 +25251,18 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorConfig(ref common Ref: ref(configv1alpha1.NodeExporterCollectorDeviceMapperMultipathConfig{}.OpenAPIModelName()), }, }, + "zoneinfo": { + SchemaProps: spec.SchemaProps{ + Description: "zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. zoneinfo is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is to not collect zoneinfo metrics. Enable when you need visibility into kernel memory zone allocation and pressure.", + Default: map[string]interface{}{}, + Ref: ref(configv1alpha1.NodeExporterCollectorZoneinfoConfig{}.OpenAPIModelName()), + }, + }, }, }, }, Dependencies: []string{ - configv1alpha1.NodeExporterCollectorBuddyInfoConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorCpufreqConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorDeviceMapperMultipathConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorEthtoolConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorKSMDConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorMountStatsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetClassConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetDevConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorProcessesConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSoftirqsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSystemdConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorTcpStatConfig{}.OpenAPIModelName()}, + configv1alpha1.NodeExporterCollectorBuddyInfoConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorCpufreqConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorDeviceMapperMultipathConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorEthtoolConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorKSMDConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorMountStatsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetClassConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetDevConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorProcessesConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSoftirqsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSystemdConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorTcpStatConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorZoneinfoConfig{}.OpenAPIModelName()}, } } @@ -25596,6 +25604,28 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorTcpStatConfig(ref } } +func schema_openshift_api_config_v1alpha1_NodeExporterCollectorZoneinfoConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeExporterCollectorZoneinfoConfig provides configuration for the zoneinfo collector of the node-exporter agent. The zoneinfo collector exposes per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. By default, the zoneinfo collector does not collect metrics.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "collectionPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "collectionPolicy declares whether the zoneinfo collector collects metrics. This field is required. Valid values are \"Collect\" and \"DoNotCollect\". When set to \"Collect\", the zoneinfo collector is active and zone memory statistics are collected. When set to \"DoNotCollect\", the zoneinfo collector is inactive.\n\nPossible enum values:\n - `\"Collect\"` means the collector is active and will produce metrics.\n - `\"DoNotCollect\"` means the collector is inactive and will not produce metrics.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Collect", "DoNotCollect"}, + }, + }, + }, + Required: []string{"collectionPolicy"}, + }, + }, + } +} + func schema_openshift_api_config_v1alpha1_NodeExporterConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/openapi/openapi.json b/openapi/openapi.json index 905160afdf9..754066c9193 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -13797,6 +13797,11 @@ "description": "tcpStat configures the tcpstat collector, which collects TCP connection statistics. tcpStat is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is disabled. Enable when debugging TCP connection behavior or capacity at the node level.", "default": {}, "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.NodeExporterCollectorTcpStatConfig" + }, + "zoneinfo": { + "description": "zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. zoneinfo is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is to not collect zoneinfo metrics. Enable when you need visibility into kernel memory zone allocation and pressure.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.NodeExporterCollectorZoneinfoConfig" } } }, @@ -14042,6 +14047,23 @@ } } }, + "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorZoneinfoConfig": { + "description": "NodeExporterCollectorZoneinfoConfig provides configuration for the zoneinfo collector of the node-exporter agent. The zoneinfo collector exposes per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. By default, the zoneinfo collector does not collect metrics.", + "type": "object", + "required": [ + "collectionPolicy" + ], + "properties": { + "collectionPolicy": { + "description": "collectionPolicy declares whether the zoneinfo collector collects metrics. This field is required. Valid values are \"Collect\" and \"DoNotCollect\". When set to \"Collect\", the zoneinfo collector is active and zone memory statistics are collected. When set to \"DoNotCollect\", the zoneinfo collector is inactive.\n\nPossible enum values:\n - `\"Collect\"` means the collector is active and will produce metrics.\n - `\"DoNotCollect\"` means the collector is inactive and will not produce metrics.", + "type": "string", + "enum": [ + "Collect", + "DoNotCollect" + ] + } + } + }, "com.github.openshift.api.config.v1alpha1.NodeExporterConfig": { "description": "NodeExporterConfig provides configuration options for the node-exporter agent that runs as a DaemonSet in the `openshift-monitoring` namespace. The node-exporter agent collects hardware and OS-level metrics from every node in the cluster, including CPU, memory, disk, and network statistics. At least one field must be specified.", "type": "object", diff --git a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml index 8a25a8e92a3..bd63fbddfce 100644 --- a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -2458,6 +2458,29 @@ spec: required: - collectionPolicy type: object + zoneinfo: + description: |- + zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, + watermarks, and protection thresholds from /proc/zoneinfo. + zoneinfo is optional. + When omitted, this means no opinion and the platform is left to choose a reasonable default, + which is subject to change over time. The current default is to not collect zoneinfo metrics. + Enable when you need visibility into kernel memory zone allocation and pressure. + properties: + collectionPolicy: + description: |- + collectionPolicy declares whether the zoneinfo collector collects metrics. + This field is required. + Valid values are "Collect" and "DoNotCollect". + When set to "Collect", the zoneinfo collector is active and zone memory statistics are collected. + When set to "DoNotCollect", the zoneinfo collector is inactive. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object type: object ignoredNetworkDevices: description: |-