victims

package
v0.0.0-...-7c8b764 Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomPodName

func RandomPodName(pods []v1.Pod) string

Pick a random pod name from a list of Pods

Types

type Victim

type Victim interface {
	VictimBaseTemplate
	VictimSpecificApiCalls
}

type VictimApiCalls

type VictimApiCalls interface {
	// Exposed Api Calls
	RunningPods(kube.Interface) ([]v1.Pod, error)
	Pods(kube.Interface) ([]v1.Pod, error)
	DeletePod(kube.Interface, string) error
	DeleteRandomPod(kube.Interface) error // Deprecated, but faster than DeleteRandomPods for single pod termination
	DeleteRandomPods(kube.Interface, int) error
	TerminateAllPods(kube.Interface) error
	IsBlacklisted() bool
	IsWhitelisted() bool
}

type VictimBase

type VictimBase struct {
	VictimBaseTemplate
	// contains filtered or unexported fields
}

func New

func New(kind, name, namespace, identifier string, mtbf int) *VictimBase

func (*VictimBase) DeletePod

func (v *VictimBase) DeletePod(clientset kube.Interface, podName string) error

Removes specified pod for victim

func (*VictimBase) DeleteRandomPod

func (v *VictimBase) DeleteRandomPod(clientset kube.Interface) error

Deprecated for DeleteRandomPods(clientset, 1) Remove a random pod for the victim

func (*VictimBase) DeleteRandomPods

func (v *VictimBase) DeleteRandomPods(clientset kube.Interface, killNum int) error

Removes specified number of random pods for the victim

func (*VictimBase) Identifier

func (v *VictimBase) Identifier() string

func (*VictimBase) IsBlacklisted

func (v *VictimBase) IsBlacklisted() bool

Check if this victim is blacklisted

func (*VictimBase) IsWhitelisted

func (v *VictimBase) IsWhitelisted() bool

Check if this victim is whitelisted

func (*VictimBase) Kind

func (v *VictimBase) Kind() string

func (*VictimBase) Mtbf

func (v *VictimBase) Mtbf() int

func (*VictimBase) Name

func (v *VictimBase) Name() string

func (*VictimBase) Namespace

func (v *VictimBase) Namespace() string

func (*VictimBase) Pods

func (v *VictimBase) Pods(clientset kube.Interface) ([]v1.Pod, error)

Returns a list of pods under the victim

func (*VictimBase) RunningPods

func (v *VictimBase) RunningPods(clientset kube.Interface) (runningPods []v1.Pod, err error)

Returns a list of running pods for the victim

func (*VictimBase) TerminateAllPods

func (v *VictimBase) TerminateAllPods(clientset kube.Interface) error

Terminate all pods for the victim, regardless of status

type VictimBaseTemplate

type VictimBaseTemplate interface {
	// Get value methods
	Kind() string
	Name() string
	Namespace() string
	Identifier() string
	Mtbf() int

	VictimApiCalls
}

type VictimSpecificApiCalls

type VictimSpecificApiCalls interface {
	// Depends on which version i.e. apps/v1 or extensions/v1beta2
	IsEnrolled(kube.Interface) (bool, error) // Get updated enroll status
	KillType(kube.Interface) (string, error) // Get updated kill config type
	KillValue(kube.Interface) (int, error)   // Get updated kill config value
}

Directories

Path Synopsis
Package factory is responsible for generating eligible victim kinds New types of kinds can be added easily
Package factory is responsible for generating eligible victim kinds New types of kinds can be added easily

Jump to

Keyboard shortcuts

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