agent

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package agent is the package that contains those implementations to obtain metadata in the specific node, any other component wants to get those data should import this package rather than get directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaAgent

type MetaAgent struct {
	sync.Mutex

	// those fetchers provide a dynamic way to collect meta info;
	// actually, those fetchers call be set by self-defined implementations
	pod.PodFetcher
	node.NodeFetcher
	types.MetricsFetcher
	cnr.CNRFetcher
	cnc.CNCFetcher
	kubeletconfig.KubeletConfigFetcher

	// ObjectFetchers provide a way to expand fetcher for objects
	ObjectFetchers sync.Map

	// machine info is fetched from once and stored in meta-server
	*machine.KatalystMachineInfo

	AgentConf *metaserver.AgentConfiguration
	// contains filtered or unexported fields
}

MetaAgent contains all those implementations for metadata running in this agent.

func NewMetaAgent

func NewMetaAgent(conf *config.Configuration, clientSet *client.GenericClientSet, emitter metrics.MetricEmitter) (*MetaAgent, error)

NewMetaAgent returns the instance of MetaAgent.

func (*MetaAgent) GetUnstructured added in v0.3.0

func (a *MetaAgent) GetUnstructured(ctx context.Context, gvr metav1.GroupVersionResource,
	namespace, name string,
) (*unstructured.Unstructured, error)

func (*MetaAgent) Run

func (a *MetaAgent) Run(ctx context.Context)

func (*MetaAgent) SetCNCFetcher added in v0.3.0

func (a *MetaAgent) SetCNCFetcher(c cnc.CNCFetcher)

func (*MetaAgent) SetCNRFetcher

func (a *MetaAgent) SetCNRFetcher(c cnr.CNRFetcher)

func (*MetaAgent) SetKubeletConfigFetcher added in v0.3.0

func (a *MetaAgent) SetKubeletConfigFetcher(k kubeletconfig.KubeletConfigFetcher)

func (*MetaAgent) SetMetricFetcher

func (a *MetaAgent) SetMetricFetcher(m types.MetricsFetcher)

func (*MetaAgent) SetNodeFetcher

func (a *MetaAgent) SetNodeFetcher(n node.NodeFetcher)

func (*MetaAgent) SetObjectFetcher added in v0.3.0

func (a *MetaAgent) SetObjectFetcher(gvr metav1.GroupVersionResource, f ObjectFetcher)

func (*MetaAgent) SetPodFetcher

func (a *MetaAgent) SetPodFetcher(p pod.PodFetcher)

type ObjectFetcher added in v0.3.0

type ObjectFetcher interface {
	// GetUnstructured returns those latest cUnstructured
	GetUnstructured(ctx context.Context, namespace, name string) (*unstructured.Unstructured, error)
}

ObjectFetcher is used to get object information.

Jump to

Keyboard shortcuts

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