diff --git a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index bd27fd8dad3..83956355cef 100644 --- a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -1799,21 +1799,6 @@ tests: - name: "memory" request: "50Mi" limit: "200Mi" - - name: Should be able to create NodeExporterConfig with valid tolerations - initial: | - apiVersion: config.openshift.io/v1alpha1 - kind: ClusterMonitoring - spec: - nodeExporterConfig: - tolerations: - - operator: "Exists" - expected: | - apiVersion: config.openshift.io/v1alpha1 - kind: ClusterMonitoring - spec: - nodeExporterConfig: - tolerations: - - operator: "Exists" - name: Should be able to create NodeExporterConfig with collectors initial: | apiVersion: config.openshift.io/v1alpha1 @@ -1869,14 +1854,10 @@ tests: kind: ClusterMonitoring spec: nodeExporterConfig: - nodeSelector: - kubernetes.io/os: linux resources: - name: "cpu" request: "50m" limit: "200m" - tolerations: - - operator: "Exists" collectors: cpuFreq: collectionPolicy: Collect @@ -1891,14 +1872,10 @@ tests: kind: ClusterMonitoring spec: nodeExporterConfig: - nodeSelector: - kubernetes.io/os: linux resources: - name: "cpu" request: "50m" limit: "200m" - tolerations: - - operator: "Exists" collectors: cpuFreq: collectionPolicy: Collect @@ -2062,71 +2039,6 @@ tests: collectors: systemd: collectionPolicy: DoNotCollect - - name: Should reject NodeExporterConfig with empty nodeSelector - initial: | - apiVersion: config.openshift.io/v1alpha1 - kind: ClusterMonitoring - spec: - nodeExporterConfig: - nodeSelector: {} - expectedError: 'spec.nodeExporterConfig.nodeSelector: Invalid value: 0: spec.nodeExporterConfig.nodeSelector in body should have at least 1 properties' - - name: Should reject NodeExporterConfig with too many nodeSelector entries - initial: | - apiVersion: config.openshift.io/v1alpha1 - kind: ClusterMonitoring - spec: - nodeExporterConfig: - nodeSelector: - key1: val1 - key2: val2 - key3: val3 - key4: val4 - key5: val5 - key6: val6 - key7: val7 - key8: val8 - key9: val9 - key10: val10 - key11: val11 - expectedError: 'spec.nodeExporterConfig.nodeSelector: Too many: 11: must have at most 10 items' - - name: Should reject NodeExporterConfig with empty tolerations array - initial: | - apiVersion: config.openshift.io/v1alpha1 - kind: ClusterMonitoring - spec: - nodeExporterConfig: - tolerations: [] - expectedError: 'spec.nodeExporterConfig.tolerations: Invalid value: 0: spec.nodeExporterConfig.tolerations in body should have at least 1 items' - - name: Should reject NodeExporterConfig with too many tolerations - initial: | - apiVersion: config.openshift.io/v1alpha1 - kind: ClusterMonitoring - spec: - nodeExporterConfig: - tolerations: - - key: "key1" - operator: "Exists" - - key: "key2" - operator: "Exists" - - key: "key3" - operator: "Exists" - - key: "key4" - operator: "Exists" - - key: "key5" - operator: "Exists" - - key: "key6" - operator: "Exists" - - key: "key7" - operator: "Exists" - - key: "key8" - operator: "Exists" - - key: "key9" - operator: "Exists" - - key: "key10" - operator: "Exists" - - key: "key11" - operator: "Exists" - expectedError: 'spec.nodeExporterConfig.tolerations: Too many: 11: must have at most 10 items' - name: Should reject systemd collect with empty object initial: | apiVersion: config.openshift.io/v1alpha1 diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index 4dbfb126812..7874d7e108e 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -240,17 +240,6 @@ type OpenShiftStateMetricsConfig struct { // At least one field must be specified. // +kubebuilder:validation:MinProperties=1 type NodeExporterConfig struct { - // nodeSelector defines the nodes on which the Pods are scheduled. - // nodeSelector is optional. - // - // When omitted, this means the user has no opinion and the platform is left - // to choose reasonable defaults. These defaults are subject to change over time. - // The current default value is `kubernetes.io/os: linux`. - // When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. - // +optional - // +kubebuilder:validation:MinProperties=1 - // +kubebuilder:validation:MaxProperties=10 - NodeSelector map[string]string `json:"nodeSelector,omitempty"` // 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. @@ -276,20 +265,6 @@ type NodeExporterConfig struct { // +kubebuilder:validation:MaxItems=5 // +kubebuilder:validation:MinItems=1 Resources []ContainerResource `json:"resources,omitempty"` - // tolerations defines tolerations for the pods. - // tolerations is optional. - // - // When omitted, this means the user has no opinion and the platform is left - // to choose reasonable defaults. These defaults are subject to change over time. - // The current default is to tolerate all taints (operator: Exists without any key), - // which is typical for DaemonSets that must run on every node. - // Maximum length for this list is 10. - // Minimum length for this list is 1. - // +kubebuilder:validation:MaxItems=10 - // +kubebuilder:validation:MinItems=1 - // +listType=atomic - // +optional - Tolerations []v1.Toleration `json:"tolerations,omitempty"` // collectors configures which node-exporter metric collectors are enabled. // collectors is optional. // Each collector can be individually enabled or disabled. Some collectors may have 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 6c184ff5b4d..5e60466c039 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 @@ -2018,20 +2018,6 @@ spec: maximum: 1024 minimum: 1 type: integer - nodeSelector: - additionalProperties: - type: string - description: |- - nodeSelector defines the nodes on which the Pods are scheduled. - nodeSelector is optional. - - When omitted, this means the user has no opinion and the platform is left - to choose reasonable defaults. These defaults are subject to change over time. - The current default value is `kubernetes.io/os: linux`. - When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. - maxProperties: 10 - minProperties: 1 - type: object resources: description: |- resources defines the compute resource requests and limits for the node-exporter container. @@ -2112,58 +2098,6 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map - tolerations: - description: |- - tolerations defines tolerations for the pods. - tolerations is optional. - - When omitted, this means the user has no opinion and the platform is left - to choose reasonable defaults. These defaults are subject to change over time. - The current default is to tolerate all taints (operator: Exists without any key), - which is typical for DaemonSets that must run on every node. - Maximum length for this list is 10. - Minimum length for this list is 1. - items: - description: |- - The pod this Toleration is attached to tolerates any taint that matches - the triple using the matching operator . - properties: - effect: - description: |- - Effect indicates the taint effect to match. Empty means match all taint effects. - When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: |- - Key is the taint key that the toleration applies to. Empty means match all taint keys. - If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: |- - Operator represents a key's relationship to the value. - Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod can - tolerate all taints of a particular category. - Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators). - type: string - tolerationSeconds: - description: |- - TolerationSeconds represents the period of time the toleration (which must be - of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint forever (do not evict). Zero and - negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: |- - Value is the taint value the toleration matches to. - If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - maxItems: 10 - minItems: 1 - type: array - x-kubernetes-list-type: atomic type: object openShiftStateMetricsConfig: description: |- diff --git a/config/v1alpha1/zz_generated.deepcopy.go b/config/v1alpha1/zz_generated.deepcopy.go index d690c688b2f..efc8bf33992 100644 --- a/config/v1alpha1/zz_generated.deepcopy.go +++ b/config/v1alpha1/zz_generated.deepcopy.go @@ -1166,13 +1166,6 @@ func (in *NodeExporterCollectorTcpStatConfig) DeepCopy() *NodeExporterCollectorT // 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 - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } if in.Resources != nil { in, out := &in.Resources, &out.Resources *out = make([]ContainerResource, len(*in)) @@ -1180,13 +1173,6 @@ func (in *NodeExporterConfig) DeepCopyInto(out *NodeExporterConfig) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]v1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } in.Collectors.DeepCopyInto(&out.Collectors) if in.IgnoredNetworkDevices != nil { in, out := &in.IgnoredNetworkDevices, &out.IgnoredNetworkDevices 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 407415920fd..113566b7fbd 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 @@ -2018,20 +2018,6 @@ spec: maximum: 1024 minimum: 1 type: integer - nodeSelector: - additionalProperties: - type: string - description: |- - nodeSelector defines the nodes on which the Pods are scheduled. - nodeSelector is optional. - - When omitted, this means the user has no opinion and the platform is left - to choose reasonable defaults. These defaults are subject to change over time. - The current default value is `kubernetes.io/os: linux`. - When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. - maxProperties: 10 - minProperties: 1 - type: object resources: description: |- resources defines the compute resource requests and limits for the node-exporter container. @@ -2112,58 +2098,6 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map - tolerations: - description: |- - tolerations defines tolerations for the pods. - tolerations is optional. - - When omitted, this means the user has no opinion and the platform is left - to choose reasonable defaults. These defaults are subject to change over time. - The current default is to tolerate all taints (operator: Exists without any key), - which is typical for DaemonSets that must run on every node. - Maximum length for this list is 10. - Minimum length for this list is 1. - items: - description: |- - The pod this Toleration is attached to tolerates any taint that matches - the triple using the matching operator . - properties: - effect: - description: |- - Effect indicates the taint effect to match. Empty means match all taint effects. - When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: |- - Key is the taint key that the toleration applies to. Empty means match all taint keys. - If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: |- - Operator represents a key's relationship to the value. - Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod can - tolerate all taints of a particular category. - Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators). - type: string - tolerationSeconds: - description: |- - TolerationSeconds represents the period of time the toleration (which must be - of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint forever (do not evict). Zero and - negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: |- - Value is the taint value the toleration matches to. - If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - maxItems: 10 - minItems: 1 - type: array - x-kubernetes-list-type: atomic type: object openShiftStateMetricsConfig: description: |- diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index ae91964235b..8c79eb06781 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -449,9 +449,7 @@ func (NodeExporterCollectorTcpStatConfig) SwaggerDoc() map[string]string { 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.", - "nodeSelector": "nodeSelector defines the nodes on which the Pods are scheduled. nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`. When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries.", "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", - "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default is to tolerate all taints (operator: Exists without any key), which is typical for DaemonSets that must run on every node. Maximum length for this list is 10. Minimum length for this list is 1.", "collectors": "collectors configures which node-exporter metric collectors are enabled. collectors is optional. Each collector can be individually enabled or disabled. Some collectors may have additional configuration options.\n\nWhen omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", "maxProcs": "maxProcs sets the target number of CPUs on which the node-exporter process will run. maxProcs is optional. Use this setting to override the default value, which is set either to 4 or to the number of CPUs on the host, whichever is smaller. The default value is computed at runtime and set via the GOMAXPROCS environment variable before node-exporter is launched. If a kernel deadlock occurs or if performance degrades when reading from sysfs concurrently, you can change this value to 1, which limits node-exporter to running on one CPU. For nodes with a high CPU count, setting the limit to a low number saves resources by preventing Go routines from being scheduled to run on all CPUs. However, I/O performance degrades if the maxProcs value is set too low and there are many metrics to collect. The minimum value is 1 and the maximum value is 1024. 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 min(4, number of host CPUs).", "ignoredNetworkDevices": "ignoredNetworkDevices is a list of regular expression patterns that match network devices to be excluded from the relevant collector configuration such as netdev, netclass, and ethtool. ignoredNetworkDevices is optional.\n\nWhen omitted, the Cluster Monitoring Operator uses a predefined list of devices to be excluded to minimize the impact on memory usage. When set as an empty list, no devices are excluded. If you modify this setting, monitor the prometheus-k8s deployment closely for excessive memory usage. Maximum length for this list is 50. Each entry must be at least 1 character and at most 1024 characters long.", diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 2aa177bbfc1..03ec0486062 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -24683,22 +24683,6 @@ func schema_openshift_api_config_v1alpha1_NodeExporterConfig(ref common.Referenc 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: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeSelector": { - SchemaProps: spec.SchemaProps{ - Description: "nodeSelector defines the nodes on which the Pods are scheduled. nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`. When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, "resources": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -24721,25 +24705,6 @@ func schema_openshift_api_config_v1alpha1_NodeExporterConfig(ref common.Referenc }, }, }, - "tolerations": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default is to tolerate all taints (operator: Exists without any key), which is typical for DaemonSets that must run on every node. Maximum length for this list is 10. Minimum length for this list is 1.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1.Toleration{}.OpenAPIModelName()), - }, - }, - }, - }, - }, "collectors": { SchemaProps: spec.SchemaProps{ Description: "collectors configures which node-exporter metric collectors are enabled. collectors is optional. Each collector can be individually enabled or disabled. Some collectors may have additional configuration options.\n\nWhen omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", @@ -24778,7 +24743,7 @@ func schema_openshift_api_config_v1alpha1_NodeExporterConfig(ref common.Referenc }, }, Dependencies: []string{ - "github.com/openshift/api/config/v1alpha1.ContainerResource", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorConfig", corev1.Toleration{}.OpenAPIModelName()}, + "github.com/openshift/api/config/v1alpha1.ContainerResource", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorConfig"}, } } 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 6c184ff5b4d..5e60466c039 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 @@ -2018,20 +2018,6 @@ spec: maximum: 1024 minimum: 1 type: integer - nodeSelector: - additionalProperties: - type: string - description: |- - nodeSelector defines the nodes on which the Pods are scheduled. - nodeSelector is optional. - - When omitted, this means the user has no opinion and the platform is left - to choose reasonable defaults. These defaults are subject to change over time. - The current default value is `kubernetes.io/os: linux`. - When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. - maxProperties: 10 - minProperties: 1 - type: object resources: description: |- resources defines the compute resource requests and limits for the node-exporter container. @@ -2112,58 +2098,6 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map - tolerations: - description: |- - tolerations defines tolerations for the pods. - tolerations is optional. - - When omitted, this means the user has no opinion and the platform is left - to choose reasonable defaults. These defaults are subject to change over time. - The current default is to tolerate all taints (operator: Exists without any key), - which is typical for DaemonSets that must run on every node. - Maximum length for this list is 10. - Minimum length for this list is 1. - items: - description: |- - The pod this Toleration is attached to tolerates any taint that matches - the triple using the matching operator . - properties: - effect: - description: |- - Effect indicates the taint effect to match. Empty means match all taint effects. - When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: |- - Key is the taint key that the toleration applies to. Empty means match all taint keys. - If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: |- - Operator represents a key's relationship to the value. - Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod can - tolerate all taints of a particular category. - Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators). - type: string - tolerationSeconds: - description: |- - TolerationSeconds represents the period of time the toleration (which must be - of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint forever (do not evict). Zero and - negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: |- - Value is the taint value the toleration matches to. - If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - maxItems: 10 - minItems: 1 - type: array - x-kubernetes-list-type: atomic type: object openShiftStateMetricsConfig: description: |-