Documentation
¶
Index ¶
Constants ¶
const ( ABSOLUTE = iota + 1 PERCENTUAL )
Sets the accepted MaxNodesUnhealthy configuration types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Defines a govaluate EvaluableExpression which is used to evaluate whether a node is reapable
ReapPredicate string
// Defines a govaluate EvaluableExpression which is used to evaluate whether a node is unhealthy
UnhealthyPredicate string
// Defines an absolute number or a percentage which serve as a limit to how many nodes may be unhealthy in a cluster before reaping can proceed
MaxNodesUnhealthy MaxNodesUnhealthy
// Defines an absolute number or a percentage which serve as a limit to how many nodes may be unhealthy in the same zone as the reapable node before reaping can proceed
MaxNodesUnhealthyInSameZone MaxNodesUnhealthy
// Grace Period when new nodes aren't reaped
NewNodeGracePeriod time.Duration
// Timeout for draining
DrainTimeout time.Duration
// Defines whether to retry draining forcefully if draining fails
DrainForceRetryOnError bool
// Grace period to be used in evict/delete call to kubernetes
PodDeletionGracePeriod time.Duration
// If true use eviction instead of directly deleting pods
UseEviction bool
// Defines whether to reap a node after draining
SkipReaping bool
// If true runs with no side effects, instead logging when it would've drained or reaped
DryRun bool
// contains filtered or unexported fields
}
Config is the configuration for node reaper.
type File ¶
type File struct {
ReapPredicate string `yaml:"reapPredicate"`
UnhealthyPredicate string `yaml:"unhealthyPredicate"`
MaxNodesUnhealthy MaxNodesUnhealthy `yaml:"maxNodesUnhealthy"`
MaxNodesUnhealthyInSameZone MaxNodesUnhealthy `yaml:"maxNodesUnhealthyInSameZone"`
NewNodeGracePeriodSeconds uint `yaml:"newNodeGracePeriodSeconds"`
DrainTimeoutSeconds uint `yaml:"drainTimeoutSeconds"`
DrainForceRetryOnError bool `yaml:"drainForceRetryOnError"`
PodDeletionGracePeriodSeconds uint `yaml:"podDeletionGracePeriodSeconds"`
UseEviction bool `yaml:"useEviction"`
SkipReaping bool `yaml:"skipReaping"`
DryRun bool `yaml:"dryRun"`
}
File is the configuration file for node reaper.
type MaxNodesUnhealthy ¶
type MaxNodesUnhealthy string
MaxNodesUnhealthy is the MaxNodesUnhealthy setting. It has its own type declaration so that it can have methods.
func (MaxNodesUnhealthy) String ¶
func (mnu MaxNodesUnhealthy) String() string
String returns MaxNodesUnhealthy value cast to string
func (MaxNodesUnhealthy) Type ¶
func (mnu MaxNodesUnhealthy) Type() (MaxNodesUnhealthyType, error)
Type returns the type of the MaxNodesUnhealthy setting. One of {ABSOLUTE, PERCENTUAL}. It's ABSOLUTE when it's solely numbers, and PERCENTUAL when it's between 1 and 3 digits and ends in a percent sign.
func (MaxNodesUnhealthy) Uint ¶
func (mnu MaxNodesUnhealthy) Uint() (uint, error)
Uint returns MaxNodesUnhealthy value cast to uint, and returns an error if the cast fails
type MaxNodesUnhealthyType ¶
type MaxNodesUnhealthyType int
MaxNodesUnhealthyType in a pseudo enum to set accepted types of the MaxNodeUnheathy property
func (MaxNodesUnhealthyType) String ¶
func (t MaxNodesUnhealthyType) String() string