controller

package
v0.0.55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionPolicyReconciler

type CollectionPolicyReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	Log               logr.Logger
	KEDAClient        *kedaclient.Clientset
	K8sClient         *kubernetes.Clientset
	DynamicClient     *dynamic.DynamicClient
	DiscoveryClient   *discovery.DiscoveryClient
	DakrClient        transport.DakrClient
	ApiExtensions     *apiextensionsclientset.Clientset
	CollectionManager *collector.CollectionManager
	MpaServer         *server.MpaServer
	Sender            transport.DirectSender
	TelemetrySender   *transport.TelemetrySender
	TelemetryMetrics  *collector.TelemetryMetrics
	TelemetryLogger   telemetry_logger.Logger
	ZapLogger         *zap.Logger
	IsRunning         bool
	CurrentPolicyHash string
	CurrentConfig     *PolicyConfig
	RestartInProgress bool
	MpaServerPort     int
}

CollectionPolicyReconciler reconciles a CollectionPolicy object

func (*CollectionPolicyReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*CollectionPolicyReconciler) SetupWithManager

func (r *CollectionPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type EnvBasedController

type EnvBasedController struct {
	client.Client
	Scheme          *runtime.Scheme
	Log             logr.Logger
	K8sClient       *kubernetes.Clientset
	DynamicClient   *dynamic.DynamicClient
	DiscoveryClient *discovery.DiscoveryClient
	ApiExtensions   *apiextensionsclientset.Clientset
	Reconciler      *CollectionPolicyReconciler
	// contains filtered or unexported fields
}

EnvBasedController is a controller that uses environment variables instead of CRDs

func NewEnvBasedController

func NewEnvBasedController(mgr ctrl.Manager, reconcileInterval time.Duration, mpaServerPort int) (*EnvBasedController, error)

NewEnvBasedController creates a new environment-based controller

func (*EnvBasedController) NeedLeaderElection

func (c *EnvBasedController) NeedLeaderElection() bool

NeedLeaderElection implements the LeaderElectionRunnable interface

func (*EnvBasedController) Start

func (c *EnvBasedController) Start(ctx context.Context) error

Start implements the Runnable interface for manager.Add

type PolicyConfig

type PolicyConfig struct {
	TargetNamespaces               []string
	ExcludedNamespaces             []string
	ExcludedPods                   []collector.ExcludedPod
	ExcludedDeployments            []collector.ExcludedDeployment
	ExcludedStatefulSets           []collector.ExcludedStatefulSet
	ExcludedDaemonSets             []collector.ExcludedDaemonSet
	ExcludedServices               []collector.ExcludedService
	ExcludedPVCs                   []collector.ExcludedPVC
	ExcludedEvents                 []collector.ExcludedEvent
	ExcludedJobs                   []collector.ExcludedJob
	ExcludedCronJobs               []collector.ExcludedCronJob
	ExcludedReplicationControllers []collector.ExcludedReplicationController
	ExcludedIngresses              []collector.ExcludedIngress
	ExcludedNetworkPolicies        []collector.ExcludedNetworkPolicy
	ExcludedEndpoints              []collector.ExcludedEndpoint
	ExcludedServiceAccounts        []collector.ExcludedServiceAccount
	ExcludedLimitRanges            []collector.ExcludedLimitRange
	ExcludedResourceQuotas         []collector.ExcludedResourceQuota
	ExcludedHPAs                   []collector.ExcludedHPA
	ExcludedVPAs                   []collector.ExcludedVPA
	ExcludedRoles                  []collector.ExcludedRole
	ExcludedRoleBindings           []collector.ExcludedRoleBinding
	ExcludedClusterRoles           []string
	ExcludedClusterRoleBindings    []string
	ExcludedPDBs                   []collector.ExcludedPDB
	ExcludedPSPs                   []string
	ExcludedCRDs                   []string
	ExcludedReplicaSet             []collector.ExcludedReplicaSet
	ExcludedStorageClasses         []string
	ExcludedPVs                    []string
	ExcludedIngressClasses         []string
	ExcludedNodes                  []string
	ExcludedCRDGroups              []string
	WatchedCRDs                    []string
	ExcludedCSINodes               []string
	ExcludedDatadogReplicaSets     []collector.ExcludedDatadogExtendedDaemonSetReplicaSet
	ExcludedArgoRollouts           []collector.ExcludedArgoRollout
	ExcludedKedaScaledJobs         []collector.ExcludedScaledJob
	ExcludedKedaScaledObjects      []collector.ExcludedScaledObject
	ExcludedCSIDrivers             []string
	ExcludedCSIStorageCapacities   []collector.ExcludedCSIStorageCapacity
	ExcludedVolumeAttachments      []string
	ExcludedKubeflowNotebooks      []collector.ExcludedKubeflowNotebook
	ExcludedVolcanoJobs            []collector.ExcludedVolcanoJob

	DisabledCollectors []string

	KubeContextName         string
	DakrURL                 string
	ClusterToken            string
	PrometheusURL           string
	DisableNetworkIOMetrics bool
	DisableGPUMetrics       bool
	UpdateInterval          time.Duration
	NodeMetricsInterval     time.Duration
	ClusterSnapshotInterval time.Duration
	BufferSize              int
	MaskSecretData          bool
	NumResourceProcessors   int
}

PolicyConfig holds the current configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL