kubernetes

package
v0.0.0-...-a692f2c Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvictNodes

func EvictNodes(client kubernetes.Interface, count int) (int, error)

EvictNodes finds a set number of random nodes to evict, and drains them of all their pods

func FlagNode

func FlagNode(client kubernetes.Interface, node *Node) error

FlagNode marks a specific node as needing to be rolled

func FlagValue

func FlagValue(flag string) func() error

FlagValue allows configuring the value for the node flag

func GenerateTestNodes

func GenerateTestNodes(count int) []runtime.Object

GenerateTestNodes generated a set number of valid and flagged nodes for tests

func NodeFlagged

func NodeFlagged() func(*metav1.ListOptions)

NodeFlagged allows filtering to find only the flagged nodes in GetNodes

func NodeNotFlagged

func NodeNotFlagged() func(*metav1.ListOptions)

NodeNotFlagged allows filtering to find only nodes that are not flagged in GetNodes

func PodNotTerminated

func PodNotTerminated() func(*metav1.ListOptions)

PodNotTerminated filters the specific pods to find by not being terminated

func PodOnNode

func PodOnNode(name string) func(*metav1.ListOptions)

PodOnNode filters the pods to find by a specific node name

func Setup

func Setup(opts ...func() error) error

Setup allows setting global configuration on the package

Types

type Node

type Node struct {
	*corev1.Node
}

Node represents a kubernetes node

func FindNode

func FindNode(client kubernetes.Interface, name string) (*Node, error)

FindNode finds a specific node by name

func GetNodes

func GetNodes(client kubernetes.Interface, opts ...func(*metav1.ListOptions)) ([]*Node, error)

GetNodes lists nodes with optional filters

func (*Node) IsFlagged

func (n *Node) IsFlagged() bool

IsFlagged checks whether the node has the dice label

func (*Node) IsReady

func (n *Node) IsReady() bool

IsReady checks whether the node is ready to accept pods

type Pod

type Pod struct {
	*corev1.Pod
}

Pod represents a kubernetes pod

func GetPods

func GetPods(client kubernetes.Interface, opts ...func(*metav1.ListOptions)) ([]*Pod, error)

GetPods lists all pods with optional filters

Jump to

Keyboard shortcuts

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