provider

package
v1.11.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// PodsGVR is the gvr of pods
	PodsGVR = corev1.SchemeGroupVersion.WithResource("pods")
	// NodesGVR is the gvr of nodes
	NodesGVR = corev1.SchemeGroupVersion.WithResource("nodes")
)

Functions

This section is empty.

Types

type CustomMetricsProvider

type CustomMetricsProvider struct {
	// contains filtered or unexported fields
}

CustomMetricsProvider is a custom metrics provider

func MakeCustomMetricsProvider

func MakeCustomMetricsProvider(clusterLister clusterlister.ClusterLister, multiClusterDiscovery multiclient.MultiClusterDiscoveryInterface) *CustomMetricsProvider

MakeCustomMetricsProvider creates a new custom metrics provider

func (*CustomMetricsProvider) GetMetricByName

GetMetricByName will query metrics by name from member clusters and return the result

func (*CustomMetricsProvider) GetMetricBySelector

func (c *CustomMetricsProvider) GetMetricBySelector(ctx context.Context, namespace string, selector labels.Selector, info provider.CustomMetricInfo, metricSelector labels.Selector) (*custom_metrics.MetricValueList, error)

GetMetricBySelector will query metrics by selector from member clusters and return the result

func (*CustomMetricsProvider) ListAllMetrics

func (c *CustomMetricsProvider) ListAllMetrics() []provider.CustomMetricInfo

ListAllMetrics returns all metrics in all member clusters

type ExternalMetricsProvider

type ExternalMetricsProvider struct {
}

ExternalMetricsProvider is a custom metrics provider

func MakeExternalMetricsProvider

func MakeExternalMetricsProvider() *ExternalMetricsProvider

MakeExternalMetricsProvider creates a new custom metrics provider

func (*ExternalMetricsProvider) GetExternalMetric

GetExternalMetric will query metrics by selector from member clusters and return the result

func (*ExternalMetricsProvider) ListAllExternalMetrics

func (c *ExternalMetricsProvider) ListAllExternalMetrics() []provider.ExternalMetricInfo

ListAllExternalMetrics returns all metrics in all member clusters

type NodeLister

type NodeLister struct {
	// contains filtered or unexported fields
}

NodeLister is an internal lister for nodes

func NewNodeLister

func NewNodeLister(clusterLister clusterlister.ClusterLister, informerManager typedmanager.MultiClusterInformerManager) *NodeLister

NewNodeLister creates an internal new NodeLister

func (*NodeLister) Get

func (n *NodeLister) Get(name string) (*corev1.Node, error)

Get returns the internal constructed node with name info

func (*NodeLister) List

func (n *NodeLister) List(selector labels.Selector) (ret []*corev1.Node, err error)

List returns the internal constructed node with label selector info

type PodLister

type PodLister struct {
	// contains filtered or unexported fields
}

PodLister is an internal lister for pods

func NewPodLister

func NewPodLister(clusterLister clusterlister.ClusterLister, informerManager typedmanager.MultiClusterInformerManager) *PodLister

NewPodLister creates an internal new PodLister

func (*PodLister) ByNamespace

func (p *PodLister) ByNamespace(namespace string) cache.GenericNamespaceLister

ByNamespace returns the pod lister with namespace info

func (*PodLister) Get

func (p *PodLister) Get(name string) (runtime.Object, error)

Get returns the internal constructed pod with name info

func (*PodLister) List

func (p *PodLister) List(selector labels.Selector) (ret []runtime.Object, err error)

List returns the internal constructed pod with label selector info

type ResourceMetricsProvider

type ResourceMetricsProvider struct {
	PodLister  *PodLister
	NodeLister *NodeLister
	// contains filtered or unexported fields
}

ResourceMetricsProvider is a resource metrics provider, to provide cpu/memory metrics

func NewResourceMetricsProvider

func NewResourceMetricsProvider(clusterLister clusterlister.ClusterLister, typedInformerManager typedmanager.MultiClusterInformerManager, informerManager genericmanager.MultiClusterInformerManager) *ResourceMetricsProvider

NewResourceMetricsProvider creates a new resource metrics provider

func (*ResourceMetricsProvider) GetNodeMetrics

func (r *ResourceMetricsProvider) GetNodeMetrics(nodes ...*corev1.Node) ([]metrics.NodeMetrics, error)

GetNodeMetrics queries metrics by the internal constructed node

func (*ResourceMetricsProvider) GetPodMetrics

GetPodMetrics queries metrics by the internal constructed pod

Jump to

Keyboard shortcuts

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