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
// 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
}
Chaoskube represents an instance of chaoskube
func New ¶
func New(client kubernetes.Interface, labels, annotations, namespaces labels.Selector, logger log.StdLogger, dryRun bool, seed int64) *Chaoskube
New returns a new instance of Chaoskube. It expects a kubernetes client, a label and 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.
func (*Chaoskube) Candidates ¶
func (c *Chaoskube) Candidates() ([]v1.Pod, error)
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) DeletePod ¶
func (c *Chaoskube) DeletePod(victim v1.Pod) error
DeletePod deletes the passed in pod iff dry run mode is enabled.
func (*Chaoskube) TerminateVictim ¶ added in v0.5.0
func (c *Chaoskube) TerminateVictim() error
TerminateVictim picks and deletes a victim if found.
Click to show internal directories.
Click to hide internal directories.