Documentation ¶
Index ¶
- func RandomPodName(pods []corev1.Pod) string
- type Victim
- type VictimAPICalls
- type VictimBase
- func (v *VictimBase) DeletePod(clientset kube.Interface, podName string) error
- func (v *VictimBase) DeleteRandomPod(clientset kube.Interface) error
- func (v *VictimBase) DeleteRandomPods(clientset kube.Interface, killNum int) error
- func (v *VictimBase) GetDeleteOptsForPod() *metav1.DeleteOptions
- func (v *VictimBase) Identifier() string
- func (v *VictimBase) IsBlacklisted() bool
- func (v *VictimBase) IsWhitelisted() bool
- func (v *VictimBase) KillNumberForFixedPercentage(clientset kube.Interface, killPercentage int) (int, error)
- func (v *VictimBase) KillNumberForKillingAll(clientset kube.Interface) (int, error)
- func (v *VictimBase) KillNumberForMaxPercentage(clientset kube.Interface, maxPercentage int) (int, error)
- func (v *VictimBase) Kind() string
- func (v *VictimBase) Mtbf() int
- func (v *VictimBase) Name() string
- func (v *VictimBase) Namespace() string
- func (v *VictimBase) Pods(clientset kube.Interface) ([]corev1.Pod, error)
- func (v *VictimBase) RunningPods(clientset kube.Interface) (runningPods []corev1.Pod, err error)
- type VictimBaseTemplate
- type VictimKillNumberGenerator
- type VictimSpecificAPICalls
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomPodName ¶
RandomPodName picks a random pod name from a list of Pods
Types ¶
type Victim ¶
type Victim interface { VictimBaseTemplate VictimSpecificAPICalls VictimKillNumberGenerator }
type VictimAPICalls ¶
type VictimAPICalls interface { // Exposed Api Calls RunningPods(kube.Interface) ([]corev1.Pod, error) Pods(kube.Interface) ([]corev1.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 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
DeletePod 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
DeleteRandomPods removes specified number of random pods for the victim
func (*VictimBase) GetDeleteOptsForPod ¶
func (v *VictimBase) GetDeleteOptsForPod() *metav1.DeleteOptions
Creates the DeleteOptions object Grace period is derived from config
func (*VictimBase) Identifier ¶
func (v *VictimBase) Identifier() string
func (*VictimBase) IsBlacklisted ¶
func (v *VictimBase) IsBlacklisted() bool
IsBlacklisted checks if this victim is blacklisted
func (*VictimBase) IsWhitelisted ¶
func (v *VictimBase) IsWhitelisted() bool
IsWhitelisted checks if this victim is whitelisted
func (*VictimBase) KillNumberForFixedPercentage ¶
func (v *VictimBase) KillNumberForFixedPercentage(clientset kube.Interface, killPercentage int) (int, error)
KillNumberForFixedPercentage returns the number of pods to kill based on a kill percentage and the number of running pods
func (*VictimBase) KillNumberForKillingAll ¶
func (v *VictimBase) KillNumberForKillingAll(clientset kube.Interface) (int, error)
KillNumberForKillingAll returns the number of pods to kill based on the number of all running pods
func (*VictimBase) KillNumberForMaxPercentage ¶
func (v *VictimBase) KillNumberForMaxPercentage(clientset kube.Interface, maxPercentage int) (int, error)
KillNumberForMaxPercentage returns a number of pods to kill based on a a random kill percentage (between 0 and maxPercentage) and the number of running pods
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) RunningPods ¶
RunningPods returns a list of running pods for the victim
type VictimBaseTemplate ¶
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 |