Documentation
¶
Index ¶
- func ApplyConfigurationFromAlertmanager(a *monitoringv1.Alertmanager, updateScaleSubresource bool) *monitoringv1ac.AlertmanagerApplyConfiguration
- func ListOptions(name string) metav1.ListOptions
- type Config
- type ConfigBuilder
- type ControllerOption
- type Operator
- func (c *Operator) Iterate(processFn func(metav1.Object, []monitoringv1.Condition))
- func (c *Operator) RefreshStatusFor(o metav1.Object)
- func (c *Operator) Run(ctx context.Context) error
- func (c *Operator) Sync(ctx context.Context, key string) error
- func (c *Operator) UpdateStatus(ctx context.Context, key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyConfigurationFromAlertmanager ¶
func ApplyConfigurationFromAlertmanager(a *monitoringv1.Alertmanager, updateScaleSubresource bool) *monitoringv1ac.AlertmanagerApplyConfiguration
func ListOptions ¶
func ListOptions(name string) metav1.ListOptions
Types ¶
type Config ¶
type Config struct {
LocalHost string
ClusterDomain string
ReloaderConfig operator.ContainerConfig
AlertmanagerDefaultBaseImage string
Annotations operator.Map
Labels operator.Map
}
Config defines the operator's parameters for the Alertmanager controller. Whenever the value of one of these parameters is changed, it triggers an update of the managed statefulsets.
type ConfigBuilder ¶
type ConfigBuilder struct {
// contains filtered or unexported fields
}
ConfigBuilder is an exported type that wraps the internal alertmanagerConfig builder.
func NewConfigBuilder ¶
func NewConfigBuilder(logger *slog.Logger, amVersion semver.Version, store *assets.StoreBuilder, matcherStrategy monitoringv1.AlertmanagerConfigMatcherStrategy) *ConfigBuilder
NewConfigBuilder creates a new ConfigBuilder. This function wraps the existing newConfigBuilder (which was unexported) and returns an exported type.
func (*ConfigBuilder) Config ¶
func (cb *ConfigBuilder) Config() *alertmanagerConfig
Config returns the generated Alertmanager configuration.
func (*ConfigBuilder) InitializeFromAlertmanagerConfig ¶
func (cb *ConfigBuilder) InitializeFromAlertmanagerConfig(ctx context.Context, globalConfig *monitoringv1.AlertmanagerGlobalConfig, amConfig *monitoringv1alpha1.AlertmanagerConfig) error
InitializeFromAlertmanagerConfig converts the given AlertmanagerConfig CR (and an optional global config) into the internal Alertmanager configuration. It wraps the internal initializeFromAlertmanagerConfig.
type ControllerOption ¶
type ControllerOption func(*Operator)
func WithStorageClassValidation ¶
func WithStorageClassValidation() ControllerOption
WithStorageClassValidation tells that the controller should verify that the Prometheus spec references a valid StorageClass name.
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
Operator manages the lifecycle of the Alertmanager statefulsets and their configurations.
func New ¶
func New(ctx context.Context, restConfig *rest.Config, c operator.Config, logger *slog.Logger, r prometheus.Registerer, options ...ControllerOption) (*Operator, error)
New creates a new controller.
func (*Operator) Iterate ¶
func (c *Operator) Iterate(processFn func(metav1.Object, []monitoringv1.Condition))
Iterate implements the operator.StatusReconciler interface.
func (*Operator) RefreshStatusFor ¶
RefreshStatus implements the operator.StatusReconciler interface.