Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPodNotFound = errors.New("pod not found")
ErrPodNotFound is returned when no victim could be found
Functions ¶
This section is empty.
Types ¶
type Chaoskube ¶
type Chaoskube struct { // a kubernetes client object Client kubernetes.Interface // a label selector which restricts the pods to choose from Labels labels.Selector // an annotation selector which restricts the pods to choose from Annotations labels.Selector // a namespace selector which restricts the pods to choose from Namespaces labels.Selector // a list of weekdays when termination is suspended ExcludedWeekdays []time.Weekday // the timezone to apply when detecting the current weekday Timezone *time.Location // an instance of logrus.StdLogger to write log messages to Logger log.StdLogger // dry run will not allow any pod terminations DryRun bool // seed value for the randomizer Seed int64 // a function to retrieve the current time Now func() time.Time }
Chaoskube represents an instance of chaoskube
func New ¶
func New(client kubernetes.Interface, labels, annotations, namespaces labels.Selector, excludedWeekdays []time.Weekday, timezone *time.Location, logger log.StdLogger, dryRun bool, seed int64) *Chaoskube
New returns a new instance of Chaoskube. It expects a kubernetes client, a label, annotation and/or namespace selector to reduce the amount of affected pods as well as whether to enable dryRun mode and a seed to seed the randomizer with. You can also provide a list of weekdays and corresponding time zone when chaoskube should be inactive.
func (*Chaoskube) Candidates ¶
Candidates returns the list of pods that are available for termination. It returns all pods matching the label selector and at least one namespace.
func (*Chaoskube) TerminateVictim ¶ added in v0.5.0
TerminateVictim picks and deletes a victim if found.
Click to show internal directories.
Click to hide internal directories.