impl

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Affinity

type Affinity struct {
	MinOperational int
}

Affinity does not pass if a node has at least one pod, which should be scheduled on operational nodes and other nodes are in maintenance-required, which do not have such a pod.

func (*Affinity) Check

func (a *Affinity) Check(params plugin.Parameters) (plugin.CheckResult, error)

func (*Affinity) ID added in v1.0.0

func (a *Affinity) ID() string

func (*Affinity) New

func (a *Affinity) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new Affinity instance with the given config.

func (*Affinity) OnTransition added in v1.0.0

func (a *Affinity) OnTransition(params plugin.Parameters) error

type AlterAnnotation

type AlterAnnotation struct {
	Key    string
	Value  string
	Remove bool
}

AlterAnnotation is a trigger plugin, which can add, change or remove an annotation.

func (*AlterAnnotation) ID added in v1.0.0

func (a *AlterAnnotation) ID() string

func (*AlterAnnotation) New

func (a *AlterAnnotation) New(config *ucfgwrap.Config) (plugin.Trigger, error)

New creates a new AlterAnnotation instance with the given config.

func (*AlterAnnotation) Trigger

func (a *AlterAnnotation) Trigger(params plugin.Parameters) error

Trigger ensures the annotation with the provided key is removed if removes is set to true. Otherwise it sets the annotation with the provided key to the provided value adding the annotation if required.

type AlterLabel

type AlterLabel struct {
	Key    string
	Value  string
	Remove bool
}

AlterLabel is a trigger plugin, which can add, change or remove a label.

func (*AlterLabel) ID added in v1.0.0

func (a *AlterLabel) ID() string

func (*AlterLabel) New

func (a *AlterLabel) New(config *ucfgwrap.Config) (plugin.Trigger, error)

New creates a new AlterLabel instance with the given config.

func (*AlterLabel) Trigger

func (a *AlterLabel) Trigger(params plugin.Parameters) error

Trigger ensures the label with the provided key is removed if removes is set to true. Otherwise it sets the label with the provided key to the provided value adding the label if required.

type AnyLabel added in v0.19.4

type AnyLabel struct {
	Key   string
	Value string
}

func (*AnyLabel) Check added in v0.19.4

func (a *AnyLabel) Check(params plugin.Parameters) (plugin.CheckResult, error)

func (*AnyLabel) ID added in v1.0.0

func (a *AnyLabel) ID() string

func (*AnyLabel) New added in v0.19.4

func (a *AnyLabel) New(config *ucfgwrap.Config) (plugin.Checker, error)

func (*AnyLabel) OnTransition added in v1.0.0

func (a *AnyLabel) OnTransition(params plugin.Parameters) error

type ClusterSemver added in v0.17.0

type ClusterSemver struct {
	Key           string
	ProfileScoped bool
}

Collects all values of the given Label key and passes if the current nodes value is less than the clusters max value, which indicates that an update may be needed.

func (*ClusterSemver) Check added in v0.17.0

func (cs *ClusterSemver) Check(params plugin.Parameters) (plugin.CheckResult, error)

func (*ClusterSemver) ID added in v1.0.0

func (cs *ClusterSemver) ID() string

func (*ClusterSemver) New added in v0.17.0

func (cs *ClusterSemver) New(config *ucfgwrap.Config) (plugin.Checker, error)

func (*ClusterSemver) OnTransition added in v1.0.0

func (cs *ClusterSemver) OnTransition(params plugin.Parameters) error

type Condition

type Condition struct {
	Type   string
	Status string
}

Condition is a check plugin that checks if a node has a certain status for a defined condition.

func (*Condition) Check

func (c *Condition) Check(params plugin.Parameters) (plugin.CheckResult, error)

Check asserts that the given status matches the specified condition.

func (*Condition) ID added in v1.0.0

func (c *Condition) ID() string

func (*Condition) New

func (c *Condition) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new Condition instance with the given config.

func (*Condition) OnTransition added in v1.0.0

func (c *Condition) OnTransition(params plugin.Parameters) error

type Eviction added in v1.6.0

type Eviction struct {
	Action          EvictionAction
	DeletionTimeout time.Duration
	EvictionTimeout time.Duration
	ForceEviction   bool
}

func (*Eviction) ID added in v1.6.0

func (e *Eviction) ID() string

func (*Eviction) New added in v1.6.0

func (e *Eviction) New(config *ucfgwrap.Config) (plugin.Trigger, error)

func (*Eviction) Trigger added in v1.6.0

func (e *Eviction) Trigger(params plugin.Parameters) error

type EvictionAction added in v1.6.0

type EvictionAction string
const (
	Drain    EvictionAction = "drain"
	Cordon   EvictionAction = "cordon"
	Uncordon EvictionAction = "uncordon"
)

type HasAnnotation

type HasAnnotation struct {
	Key   string
	Value string
}

HasAnnotation is a check plugin that checks whether a node has an annotation or an annotation with a certain value.

func (*HasAnnotation) Check

func (h *HasAnnotation) Check(params plugin.Parameters) (plugin.CheckResult, error)

Check checks whether a node has an annotation (if h.Value == "") or an annotation with a certain value (if h.Value != "").

func (*HasAnnotation) ID added in v1.0.0

func (h *HasAnnotation) ID() string

func (*HasAnnotation) New

func (h *HasAnnotation) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new HasAnnotation instance with the given config.

func (*HasAnnotation) OnTransition added in v1.0.0

func (h *HasAnnotation) OnTransition(params plugin.Parameters) error

type HasLabel

type HasLabel struct {
	Key   string
	Value string
}

HasLabel is a check plugin that checks whether a node has a label or a label with a certain value.

func (*HasLabel) Check

func (h *HasLabel) Check(params plugin.Parameters) (plugin.CheckResult, error)

Check checks whether a node has a label (if h.Value == "") or a label with a certain value (if h.Value != "").

func (*HasLabel) ID added in v1.0.0

func (h *HasLabel) ID() string

func (*HasLabel) New

func (h *HasLabel) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new HasLabel instance with the given config.

func (*HasLabel) OnTransition added in v1.0.0

func (h *HasLabel) OnTransition(params plugin.Parameters) error

type KubernikusCount added in v0.19.0

type KubernikusCount struct {
	Cluster string
}

func (*KubernikusCount) Check added in v0.19.0

func (*KubernikusCount) ID added in v1.0.0

func (kc *KubernikusCount) ID() string

func (*KubernikusCount) New added in v0.19.0

func (kc *KubernikusCount) New(config *ucfgwrap.Config) (plugin.Checker, error)

func (*KubernikusCount) OnTransition added in v1.0.0

func (kc *KubernikusCount) OnTransition(params plugin.Parameters) error

type Mail

type Mail struct {
	Auth     bool
	Message  string
	Subject  string
	Address  string
	From     string
	To       []string
	Identity string
	User     string
	Password string
}

Mail is a notification plugins that sends an e-mail.

func (*Mail) ID added in v1.0.0

func (m *Mail) ID() string

func (*Mail) New

func (m *Mail) New(config *ucfgwrap.Config) (plugin.Notifier, error)

New creates a new Mail instance with the given config.

func (*Mail) Notify

func (m *Mail) Notify(params plugin.Parameters) error

Notify performs connects to the provided SMTP server and transmits the configured message.

type MaxMaintenance

type MaxMaintenance struct {
	MaxNodes  int
	Profile   string
	GroupBy   []string
	SkipAfter time.Duration
}

MaxMaintenance is a check plugin that checks whether the amount of nodes with the in-maintenance state does not exceed the specified amount.

func (*MaxMaintenance) Check

Check asserts that no more then the specified amount of nodes is in the in-maintenance state.

func (*MaxMaintenance) ID added in v1.0.0

func (m *MaxMaintenance) ID() string

func (*MaxMaintenance) New

func (m *MaxMaintenance) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new MaxMaintenance instance with the given config.

func (*MaxMaintenance) OnTransition added in v1.0.0

func (m *MaxMaintenance) OnTransition(params plugin.Parameters) error

type NodeCount

type NodeCount struct {
	Count int
}

func (*NodeCount) Check

func (n *NodeCount) Check(params plugin.Parameters) (plugin.CheckResult, error)

Check asserts that the cluster has at least the configured amount of nodes.

func (*NodeCount) ID added in v1.0.0

func (n *NodeCount) ID() string

func (*NodeCount) New

func (n *NodeCount) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new Count instance with the given config.

func (*NodeCount) OnTransition added in v1.0.0

func (n *NodeCount) OnTransition(params plugin.Parameters) error

type PrometheusInstant added in v1.1.0

type PrometheusInstant struct {
	URL   string
	Query string
	Expr  string
}

HasLabel is a check plugin that queries a prometheus for the most recent value of a query, which is checked against a given expression.

func (*PrometheusInstant) Check added in v1.1.0

Queries the prometheus and evaluate the result against the given expression.

func (*PrometheusInstant) ID added in v1.1.0

func (pi *PrometheusInstant) ID() string

func (*PrometheusInstant) New added in v1.1.0

func (pi *PrometheusInstant) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new PrometheusInstant instance with the given config.

func (*PrometheusInstant) OnTransition added in v1.1.0

func (pi *PrometheusInstant) OnTransition(params plugin.Parameters) error

type SlackThread

type SlackThread struct {
	Token     string
	Channel   string
	Title     string
	Message   string
	LeaseName types.NamespacedName
	Period    time.Duration
	// contains filtered or unexported fields
}

Slack is a notification plugin that uses a slack webhook and a channel to post a notification about the nodes state in slack while grouping messages within a certain period in a thread.

func (*SlackThread) ID added in v1.0.0

func (st *SlackThread) ID() string

func (*SlackThread) New

func (st *SlackThread) New(config *ucfgwrap.Config) (plugin.Notifier, error)

New creates a new Slack instance with the given config.

func (*SlackThread) Notify

func (st *SlackThread) Notify(params plugin.Parameters) error

func (*SlackThread) SetTestURL

func (st *SlackThread) SetTestURL(url string)

type SlackWebhook

type SlackWebhook struct {
	Hook    string
	Channel string
	Message string
}

SlackWebhook is a notification plugin that uses a slack webhook and a channel to post a notification about the nodes state in slack.

func (*SlackWebhook) ID added in v1.0.0

func (sw *SlackWebhook) ID() string

func (*SlackWebhook) New

func (sw *SlackWebhook) New(config *ucfgwrap.Config) (plugin.Notifier, error)

New creates a new Slack instance with the given config.

func (*SlackWebhook) Notify

func (sw *SlackWebhook) Notify(params plugin.Parameters) error

Notify performs a POST-Request to the slack API to create a message within slack.

type Stagger

type Stagger struct {
	Duration       time.Duration
	LeaseName      string
	LeaseNamespace string
	Parallel       int
	// contains filtered or unexported fields
}

Stagger is a check plugin that checks that only one node can pass every configurable period.

func (*Stagger) Check

func (s *Stagger) Check(params plugin.Parameters) (plugin.CheckResult, error)

Check asserts that since the last successful check is a certain time has passed.

func (*Stagger) ID added in v1.0.0

func (s *Stagger) ID() string

func (*Stagger) New

func (s *Stagger) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new Stagger instance with the given config.

func (*Stagger) OnTransition added in v1.0.0

func (s *Stagger) OnTransition(params plugin.Parameters) error

If the whole check chain passed, the lease needs to be grabed, so other nodes are blocked from progressing.

type TimeWindow

type TimeWindow struct {
	Start    time.Time
	End      time.Time
	Weekdays []time.Weekday
	Exclude  []time.Time
}

TimeWindow is a check plugin that checks whether it is invoked on a certain weekday with a specified timewindow.

func (*TimeWindow) Check

func (tw *TimeWindow) Check(params plugin.Parameters) (plugin.CheckResult, error)

Check checks whether the current time is within specified time window on allowed weekdays.

func (*TimeWindow) ID added in v1.0.0

func (tw *TimeWindow) ID() string

func (*TimeWindow) New

func (tw *TimeWindow) New(config *ucfgwrap.Config) (plugin.Checker, error)

New creates a new TimeWindow instance with the given config.

func (*TimeWindow) OnTransition added in v1.0.0

func (tw *TimeWindow) OnTransition(params plugin.Parameters) error

type Wait

type Wait struct {
	Duration time.Duration
}

func (*Wait) Check

func (w *Wait) Check(params plugin.Parameters) (plugin.CheckResult, error)

func (*Wait) ID added in v1.0.0

func (w *Wait) ID() string

func (*Wait) New

func (w *Wait) New(config *ucfgwrap.Config) (plugin.Checker, error)

func (*Wait) OnTransition added in v1.0.0

func (w *Wait) OnTransition(params plugin.Parameters) error

type WaitExclude

type WaitExclude struct {
	Duration time.Duration
	Exclude  []time.Weekday
}

func (*WaitExclude) Check

func (we *WaitExclude) Check(params plugin.Parameters) (plugin.CheckResult, error)

func (*WaitExclude) ID added in v1.0.0

func (we *WaitExclude) ID() string

func (*WaitExclude) New

func (we *WaitExclude) New(config *ucfgwrap.Config) (plugin.Checker, error)

func (*WaitExclude) OnTransition added in v1.0.0

func (we *WaitExclude) OnTransition(params plugin.Parameters) error

Jump to

Keyboard shortcuts

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