utils

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KubeletKillerPodName contains the name of the pod that stops kubelet process
	KubeletKillerPodName = "kubelet-killer"
	// MachineAnnotationKey contains machine annotation key
	MachineAnnotationKey = "machine.openshift.io/machine"
	// MachineHealthCheckName contains the name of the machinehealthcheck used for tests
	MachineHealthCheckName = "workers-check"
	// NamespaceOpenShiftMachineAPI contains the openshift-machine-api namespace name
	NamespaceOpenShiftMachineAPI = "openshift-machine-api"
	// WorkerNodeRoleLabel contains the label of worker node
	WorkerNodeRoleLabel = "node-role.kubernetes.io/worker"
)
View Source
const (
	// WaitLong contains number of minutes to wait before long timeout
	WaitLong = 10 * time.Minute
)

Variables

This section is empty.

Functions

func CreateMachineHealthCheck

func CreateMachineHealthCheck(name string, labels map[string]string) error

CreateMachineHealthCheck will create MachineHealthCheck CR with the relevant selector

func CreateUnhealthyConditionsConfigMap

func CreateUnhealthyConditionsConfigMap(unhealthyConditions *conditions.UnhealthyConditions) error

CreateUnhealthyConditionsConfigMap creates node-unhealthy-conditions configmap with relevant conditions

func DeleteKubeletKillerPods

func DeleteKubeletKillerPods() error

DeleteKubeletKillerPods deletes kubelet killer pod

func DeleteMachineHealthCheck

func DeleteMachineHealthCheck(healthcheckName string) error

DeleteMachineHealthCheck deletes machine health check by name

func DeleteUnhealthyConditionsConfigMap

func DeleteUnhealthyConditionsConfigMap() error

DeleteUnhealthyConditionsConfigMap deletes node-unhealthy-conditions configmap

func FilterReadyNodes

func FilterReadyNodes(nodes []corev1.Node) []corev1.Node

FilterReadyNodes fileter the list of nodes and returns the list with ready nodes

func GetMachine

func GetMachine(c client.Client, machineName string) (*mapiv1.Machine, error)

GetMachine get a machine by its name from the default machine API namespace.

func GetMachineFromNode

func GetMachineFromNode(c client.Client, node *corev1.Node) (*mapiv1.Machine, error)

GetMachineFromNode returns the machine referenced by the "controllernode.MachineAnnotationKey" annotation in the given node

func GetMachinesSetByMachine

func GetMachinesSetByMachine(machine *mapiv1.Machine) (*mapiv1.MachineSet, error)

GetMachinesSetByMachine retruns machine owner machine set

func GetWorkerNodes

func GetWorkerNodes(c client.Client) ([]corev1.Node, error)

GetWorkerNodes returns all nodes with the nodeWorkerRoleLabel label

func Init

func Init()

Init will initialize the kubeconfig variable for command line parameters

func IsNodeReady

func IsNodeReady(node *corev1.Node) bool

IsNodeReady returns true once node is ready

func LoadClient

func LoadClient() (client.Client, error)

LoadClient builds controller runtime client that accepts any registered type

func LoadConfig

func LoadConfig() (*rest.Config, error)

LoadConfig builds config from kubernetes config

func NewMachineDisruptionBudget

func NewMachineDisruptionBudget(name string, machineLabels map[string]string, minAvailable *int32, maxUnavailable *int32) *mrv1.MachineDisruptionBudget

NewMachineDisruptionBudget returns new MachineDisruptionObject with specified parameters

func StopKubelet

func StopKubelet(nodeName string) error

StopKubelet creates pod in the node PID namespace that stops kubelet process

Types

This section is empty.

Jump to

Keyboard shortcuts

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