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, nodeName string) 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 { // UpdateConfig trigger dynamic configuration update directly UpdateConfig(ctx context.Context) error // AddConfigWatcher add gvr to list which will be watched to get dynamic configuration AddConfigWatcher(gvrs ...metav1.GroupVersionResource) error // Register is used when a user wants to get dynamic configuration Register(registers ...ConfigurationRegister) // 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, conf *pkgconfig.Configuration) (ConfigurationManager, error)
NewDynamicConfigManager new a dynamic config manager use katalyst custom config sdk.
type ConfigurationRegister ¶
type ConfigurationRegister interface {
ApplyConfig(*pkgconfig.DynamicConfiguration)
}
ConfigurationRegister indicates that each user should pass an ConfigurationRegister function to ConfigManager; every time when user-interested configuration changes, the ConfigManager should call the ConfigurationRegister function to notify this change event.
type Data ¶
type Data struct { // Data maps from kind to target config data Data map[string]TargetConfigData Checksum checksum.Checksum }
Data holds checkpoint data and its checksum
func (*Data) MarshalCheckpoint ¶
func (*Data) UnmarshalCheckpoint ¶
func (*Data) VerifyChecksum ¶
type DummyConfigurationRegister ¶
type DummyConfigurationRegister struct{}
func (*DummyConfigurationRegister) ApplyConfig ¶
func (d *DummyConfigurationRegister) ApplyConfig(*pkgconfig.DynamicConfiguration)
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) Register ¶
func (c *DynamicConfigManager) Register(register ...ConfigurationRegister)
Register is to add configurationRegister to a list which will be applied
func (*DynamicConfigManager) Run ¶
func (c *DynamicConfigManager) Run(ctx context.Context)
Run is to start update config loops until the context is done
func (*DynamicConfigManager) UpdateConfig ¶
func (c *DynamicConfigManager) UpdateConfig(ctx context.Context) error
UpdateConfig is to update dynamic config directly
type TargetConfigData ¶
type TargetConfigData struct { // Value only store spec of dynamic config crd Value *dynamic.DynamicConfigCRD Timestamp metav1.Timestamp }