katalyst_base

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 54 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericContext

type GenericContext struct {
	*http.Server

	// those following components are shared by all generic components.
	//nolint
	BroadcastAdapter events.EventBroadcasterAdapter
	Client           *client.GenericClientSet
	EmitterPool      metricspool.MetricsEmitterPool

	// those following informer factories give access to informers for the component.
	// actually, for agent, we should be cautious if we decide to start informers (
	// to reduce connections with APIServer).
	//
	// since those variables may be un-initialized in some component, we must be
	// very careful when we use them
	MetaInformerFactory       metadatainformer.SharedInformerFactory
	KubeInformerFactory       informers.SharedInformerFactory
	InternalInformerFactory   externalversions.SharedInformerFactory
	DynamicInformerFactory    dynamicinformer.DynamicSharedInformerFactory
	AggregatorInformerFactory aggregator.SharedInformerFactory
	DynamicResourcesManager   *native.DynamicResourcesManager

	// DisabledByDefault is the set of components which is disabled by default
	DisabledByDefault sets.String
	// contains filtered or unexported fields
}

func GenerateFakeGenericContext

func GenerateFakeGenericContext(objects ...[]runtime.Object) (*GenericContext, error)

func NewGenericContext

func NewGenericContext(
	clientSet *client.GenericClientSet,
	labelSelector string,
	dynamicResources []string,
	disabledByDefault sets.String,
	genericConf *generic.GenericConfiguration,
	component consts.KatalystComponent,
	dynamicConfiguration *dynamic.DynamicAgentConfiguration,
) (*GenericContext, error)

func (*GenericContext) IsEnabled

func (c *GenericContext) IsEnabled(name string, components []string) bool

IsEnabled checks if the context's components enabled or not

func (*GenericContext) Run

func (c *GenericContext) Run(ctx context.Context)

Run starts the generic components

func (*GenericContext) SetDefaultMetricsEmitter

func (c *GenericContext) SetDefaultMetricsEmitter(metricEmitter metrics.MetricEmitter)

SetDefaultMetricsEmitter to set default metrics emitter by custom metric emitter

func (*GenericContext) StartInformer

func (c *GenericContext) StartInformer(ctx context.Context)

StartInformer starts the shared informer factories; informer is reentrant, so it's no need to check if context has been started

type GenericOptions

type GenericOptions func(i interface{})

GenericOptions is used as an extendable way to support

type HealthzChecker added in v0.2.0

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

HealthzChecker periodically checks the running states

func NewHealthzChecker added in v0.2.0

func NewHealthzChecker() *HealthzChecker

func (*HealthzChecker) CheckHealthy added in v0.2.0

func (h *HealthzChecker) CheckHealthy() (bool, string)

CheckHealthy returns whether the component is healthy.

func (*HealthzChecker) Run added in v0.2.0

func (h *HealthzChecker) Run(_ context.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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