kubernetes

package
v1.35.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// MinMasters - Minimum number of master nodes the cluster can survive with.
	MinMasters = 1

	// MinWorkers - Minimum number of workers nodes the cluster can survive with.
	MinWorkers = 2
)

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