Documentation ¶
Index ¶
- type Affinity
- type AlterAnnotation
- type AlterLabel
- type AnyLabel
- type ClusterSemver
- type Condition
- type HasAnnotation
- type HasLabel
- type KubernikusCount
- type Mail
- type MaxMaintenance
- type NodeCount
- type PrometheusInstant
- type SlackThread
- type SlackWebhook
- type Stagger
- type TimeWindow
- type Wait
- type WaitExclude
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Affinity ¶
type Affinity struct{}
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) OnTransition ¶ added in v1.0.0
func (a *Affinity) OnTransition(params plugin.Parameters) error
type AlterAnnotation ¶
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) 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 ¶
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) 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
func (*AnyLabel) Check ¶ added in v0.19.4
func (a *AnyLabel) Check(params plugin.Parameters) (plugin.CheckResult, error)
func (*AnyLabel) OnTransition ¶ added in v1.0.0
func (a *AnyLabel) OnTransition(params plugin.Parameters) error
type ClusterSemver ¶ added in v0.17.0
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) OnTransition ¶ added in v1.0.0
func (cs *ClusterSemver) OnTransition(params plugin.Parameters) error
type Condition ¶
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) OnTransition ¶ added in v1.0.0
func (c *Condition) OnTransition(params plugin.Parameters) error
type HasAnnotation ¶
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) OnTransition ¶ added in v1.0.0
func (h *HasAnnotation) OnTransition(params plugin.Parameters) error
type HasLabel ¶
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) 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 (kc *KubernikusCount) Check(params plugin.Parameters) (plugin.CheckResult, error)
func (*KubernikusCount) ID ¶ added in v1.0.0
func (kc *KubernikusCount) ID() string
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.
type MaxMaintenance ¶
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 ¶
func (m *MaxMaintenance) Check(params plugin.Parameters) (plugin.CheckResult, error)
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) 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) OnTransition ¶ added in v1.0.0
func (n *NodeCount) OnTransition(params plugin.Parameters) error
type PrometheusInstant ¶ added in v1.1.0
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
func (pi *PrometheusInstant) Check(params plugin.Parameters) (plugin.CheckResult, error)
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
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) Notify ¶
func (st *SlackThread) Notify(params plugin.Parameters) error
func (*SlackThread) SetTestURL ¶
func (st *SlackThread) SetTestURL(url string)
type SlackWebhook ¶
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) 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) 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) OnTransition ¶ added in v1.0.0
func (tw *TimeWindow) OnTransition(params plugin.Parameters) error
type Wait ¶
func (*Wait) Check ¶
func (w *Wait) Check(params plugin.Parameters) (plugin.CheckResult, error)
func (*Wait) OnTransition ¶ added in v1.0.0
func (w *Wait) OnTransition(params plugin.Parameters) error
type WaitExclude ¶
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) OnTransition ¶ added in v1.0.0
func (we *WaitExclude) OnTransition(params plugin.Parameters) error