kubernetes

package
v1.32.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MinMasters = 1

MinMasters - Minimum number of master nodes the cluster can survive with.

View Source
const MinWorkers = 2

MinWorkers - Minimum number of workers nodes the cluster can survive with.

Variables

This section is empty.

Functions

func IsMaster

func IsMaster(node corev1.Node) bool

IsMaster - Returns true if the given node is a master.

Types

type NodeMap

type NodeMap map[string]corev1.Node

NodeMap - Data type to hold a map between NCN name and Kubernetes node pointer.

type UtilsClient

type UtilsClient struct {
	Logger kubernetesLogger
	// contains filtered or unexported fields
}

UtilsClient - Structure for kubernetes client.

func NewKubernetesClient

func NewKubernetesClient(kubeconfig string) (utilsClient *UtilsClient, err error)

NewKubernetesClient - Creates a new kubernetes client.

func (*UtilsClient) ChangeNCNCordonState

func (utilsClient *UtilsClient) ChangeNCNCordonState(ncn string, cordoned bool) error

ChangeNCNCordonState - Cordons or uncordons the given NCN.

func (*UtilsClient) CordonNCN

func (utilsClient *UtilsClient) CordonNCN(ncn string) error

CordonNCN - Cordons the given NCN.

func (*UtilsClient) DeleteNCN

func (utilsClient *UtilsClient) DeleteNCN(ncn string) error

DeleteNCN - Deletes the NCN from Kubernetes.

func (*UtilsClient) DrainNCN

func (utilsClient *UtilsClient) DrainNCN(ncn string) error

DrainNCN - Draining an NCN is really 3 individual steps:

  1. Cordon the node.
  2. Identify any pods that might be on that node in violation of any pod distribution budgets and move them.
  3. Drain the node.

func (*UtilsClient) GetNodes

func (utilsClient *UtilsClient) GetNodes() (nodeMap NodeMap, err error)

GetNodes - Returns a map of all the nodes.

func (*UtilsClient) IsMember

func (utilsClient *UtilsClient) IsMember(ncn string) (bool, error)

IsMember - Returns true if the given NCN is a member of Kubernetes.

func (*UtilsClient) UnCordonNCN

func (utilsClient *UtilsClient) UnCordonNCN(ncn string) error

UnCordonNCN - Uncordons the given NCN.

Jump to

Keyboard shortcuts

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