// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1alpha1

import (
	configv1alpha1 "github.com/openshift/api/config/v1alpha1"
)

// NodeExporterConfigApplyConfiguration represents a declarative configuration of the NodeExporterConfig type for use
// with apply.
//
// 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 NodeExporterConfigApplyConfiguration struct {
	// 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:
	// resources:
	// - name: cpu
	// request: 8m
	// limit: null
	// - name: memory
	// request: 32Mi
	// limit: null
	// ---
	// maxItems is set to 5 to stay within the Kubernetes CRD CEL validation cost budget.
	// See the MaxItems comment near the ContainerResource type definition for details.
	// Minimum length for this list is 1.
	// Each resource name must be unique within this list.
	Resources []ContainerResourceApplyConfiguration `json:"resources,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
	// additional configuration options.
	//
	// When omitted, this means no opinion and the platform is left to choose a reasonable
	// default, which is subject to change over time.
	Collectors *NodeExporterCollectorConfigApplyConfiguration `json:"collectors,omitempty"`
	// 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).
	MaxProcs *int32 `json:"maxProcs,omitempty"`
	// 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.
	//
	// When 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.
	IgnoredNetworkDevices *[]configv1alpha1.NodeExporterIgnoredNetworkDevice `json:"ignoredNetworkDevices,omitempty"`
}

// NodeExporterConfigApplyConfiguration constructs a declarative configuration of the NodeExporterConfig type for use with
// apply.
func NodeExporterConfig() *NodeExporterConfigApplyConfiguration {
	return &NodeExporterConfigApplyConfiguration{}
}

// WithResources adds the given value to the Resources field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Resources field.
func (b *NodeExporterConfigApplyConfiguration) WithResources(values ...*ContainerResourceApplyConfiguration) *NodeExporterConfigApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithResources")
		}
		b.Resources = append(b.Resources, *values[i])
	}
	return b
}

// WithCollectors sets the Collectors field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Collectors field is set to the value of the last call.
func (b *NodeExporterConfigApplyConfiguration) WithCollectors(value *NodeExporterCollectorConfigApplyConfiguration) *NodeExporterConfigApplyConfiguration {
	b.Collectors = value
	return b
}

// WithMaxProcs sets the MaxProcs field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MaxProcs field is set to the value of the last call.
func (b *NodeExporterConfigApplyConfiguration) WithMaxProcs(value int32) *NodeExporterConfigApplyConfiguration {
	b.MaxProcs = &value
	return b
}

// WithIgnoredNetworkDevices sets the IgnoredNetworkDevices field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the IgnoredNetworkDevices field is set to the value of the last call.
func (b *NodeExporterConfigApplyConfiguration) WithIgnoredNetworkDevices(value []configv1alpha1.NodeExporterIgnoredNetworkDevice) *NodeExporterConfigApplyConfiguration {
	b.IgnoredNetworkDevices = &value
	return b
}
