Documentation ¶
Overview ¶
Package config is the package that gets centralized configurations periodically and dynamically for a given node.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigManagerCheckpoint ¶
type ConfigManagerCheckpoint interface { checkpointmanager.Checkpoint GetData(kind string) (reflect.Value, metav1.Time) SetData(kind string, v reflect.Value, t metav1.Time) }
func NewCheckpoint ¶
func NewCheckpoint(configResponses map[string]TargetConfigData) ConfigManagerCheckpoint
NewCheckpoint returns an instance of Checkpoint
type ConfigurationLoader ¶
type ConfigurationLoader interface {
LoadConfig(ctx context.Context, gvr metav1.GroupVersionResource, conf interface{}) error
}
ConfigurationLoader is used to load configurations from centralized server.
func NewKatalystCustomConfigLoader ¶
func NewKatalystCustomConfigLoader(clientSet *client.GenericClientSet, ttl time.Duration, cncFetcher cnc.CNCFetcher, ) ConfigurationLoader
NewKatalystCustomConfigLoader create a new configManager to fetch KatalystCustomConfig. every LoadConfig() call tries to fetch the value from local cache; if it is not there, invalidated or too old, we fetch it from api-server and refresh the value in cache; otherwise it is just fetched from cache. defaultGVRList s the list of default gvr fetched from remote api-server, if LoadConfig() fetches a new gvr, it will be automatically added to.
type ConfigurationManager ¶
type ConfigurationManager interface { // InitializeConfig trigger dynamic configuration initialize directly InitializeConfig(ctx context.Context) error // AddConfigWatcher add gvr to list which will be watched to get dynamic configuration AddConfigWatcher(gvrs ...metav1.GroupVersionResource) error // Run starts the main loop Run(ctx context.Context) }
ConfigurationManager is a user for ConfigurationLoader working for dynamic configuration manager
func NewDynamicConfigManager ¶
func NewDynamicConfigManager(clientSet *client.GenericClientSet, emitter metrics.MetricEmitter, cncFetcher cnc.CNCFetcher, conf *pkgconfig.Configuration, ) (ConfigurationManager, error)
NewDynamicConfigManager new a dynamic config manager use katalyst custom config sdk.
type Data ¶
Data holds checkpoint data and its checksum
func (*Data) MarshalCheckpoint ¶
func (*Data) UnmarshalCheckpoint ¶
func (*Data) VerifyChecksum ¶
type DataItem ¶
type DataItem struct { // Data maps from kind to target config data Data map[string]TargetConfigData Checksum checksum.Checksum }
type DummyConfigurationManager ¶
type DummyConfigurationManager struct{}
func (*DummyConfigurationManager) AddConfigWatcher ¶
func (d *DummyConfigurationManager) AddConfigWatcher(_ ...metav1.GroupVersionResource) error
func (*DummyConfigurationManager) InitializeConfig ¶
func (d *DummyConfigurationManager) InitializeConfig(_ context.Context) error
func (*DummyConfigurationManager) Run ¶
func (d *DummyConfigurationManager) Run(_ context.Context)
type DynamicConfigManager ¶
type DynamicConfigManager struct {
// contains filtered or unexported fields
}
DynamicConfigManager is to fetch dynamic config from remote
func (*DynamicConfigManager) AddConfigWatcher ¶
func (c *DynamicConfigManager) AddConfigWatcher(gvrs ...metav1.GroupVersionResource) error
AddConfigWatcher add gvr to list which will be watched to get dynamic configuration
func (*DynamicConfigManager) InitializeConfig ¶
func (c *DynamicConfigManager) InitializeConfig(ctx context.Context) error
InitializeConfig will try to initialize dynamic config
func (*DynamicConfigManager) Run ¶
func (c *DynamicConfigManager) Run(ctx context.Context)
Run is to start update config loops until the context is done
type TargetConfigData ¶
type TargetConfigData struct { // Value only store spec of dynamic config crd Value *crd.DynamicConfigCRD Timestamp int64 }