nodes

package
v0.0.0-...-75a2d0c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListExternalIPv4Networks

func ListExternalIPv4Networks(apiClient *clients.Settings, options ...metav1.ListOptions) ([]string, error)

ListExternalIPv4Networks returns a list of node's external ipv4 addresses.

func WaitForAllNodesAreReady

func WaitForAllNodesAreReady(apiClient *clients.Settings,
	timeout time.Duration,
	options ...metav1.ListOptions) (bool, error)

WaitForAllNodesAreReady waits for all nodes to be Ready for a time duration up to the timeout.

func WaitForAllNodesToReboot

func WaitForAllNodesToReboot(apiClient *clients.Settings,
	globalRebootTimeout time.Duration,
	options ...metav1.ListOptions) (bool, error)

WaitForAllNodesToReboot waits for all nodes to start and finish reboot up to the timeout.

Types

type AdditionalOptions

type AdditionalOptions func(builder *Builder) (*Builder, error)

AdditionalOptions additional options for node object.

type Builder

type Builder struct {
	Definition *corev1.Node
	Object     *corev1.Node
	// contains filtered or unexported fields
}

Builder provides struct for Node object containing connection to the cluster and the list of Node definitions.

func List

func List(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*Builder, error)

List returns node inventory.

func Pull

func Pull(apiClient *clients.Settings, nodeName string) (*Builder, error)

Pull gathers existing node from cluster.

func (*Builder) Cordon

func (builder *Builder) Cordon() error

Cordon marks node as unschedulable.

func (*Builder) Delete

func (builder *Builder) Delete() error

Delete removes node from the cluster.

func (*Builder) Drain

func (builder *Builder) Drain() error

Drain evicts or deletes all pods.

func (*Builder) Exists

func (builder *Builder) Exists() bool

Exists checks whether the given node exists.

func (*Builder) ExternalIPv4Network

func (builder *Builder) ExternalIPv4Network() (string, error)

ExternalIPv4Network returns nodes external ip address.

func (*Builder) IsReady

func (builder *Builder) IsReady() (bool, error)

IsReady check if the Node is Ready.

func (*Builder) RemoveLabel

func (builder *Builder) RemoveLabel(key, value string) *Builder

RemoveLabel removes given label from Node metadata.

func (*Builder) SetDrainHelper

func (builder *Builder) SetDrainHelper(
	force bool,
	ignoreDaemonsets bool,
	deleteLocalData bool,
	gracePeriod int,
	skipWaitForDeleteTimeoutSeconds int,
	timeout time.Duration,
)

SetDrainHelper builds drain Helper that contains parameters to control the behaviour of drain.

func (*Builder) Uncordon

func (builder *Builder) Uncordon() error

Uncordon marks node as schedulable.

func (*Builder) Update

func (builder *Builder) Update() (*Builder, error)

Update renovates the existing node object with the node definition in builder.

func (*Builder) WaitUntilConditionTrue

func (builder *Builder) WaitUntilConditionTrue(
	conditionType corev1.NodeConditionType, timeout time.Duration) error

WaitUntilConditionTrue waits for timeout duration or until node gets to a specific status.

func (*Builder) WaitUntilConditionUnknown

func (builder *Builder) WaitUntilConditionUnknown(
	conditionType corev1.NodeConditionType, timeout time.Duration) error

WaitUntilConditionUnknown waits for timeout duration or until the provided condition type does not have status Unknown.

func (*Builder) WaitUntilNotReady

func (builder *Builder) WaitUntilNotReady(timeout time.Duration) error

WaitUntilNotReady waits for timeout duration or until node is NotReady.

func (*Builder) WaitUntilReady

func (builder *Builder) WaitUntilReady(timeout time.Duration) error

WaitUntilReady waits for timeout duration or until node is Ready.

func (*Builder) WithNewLabel

func (builder *Builder) WithNewLabel(key, value string) *Builder

WithNewLabel defines the new label placed in the Node metadata.

func (*Builder) WithOptions

func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder

WithOptions creates node with generic mutation options.

type ExternalNetworks

type ExternalNetworks struct {
	IPv4 string `json:"ipv4,omitempty"`
	IPv6 string `json:"ipv6,omitempty"`
}

ExternalNetworks contains external node ip4/ipv6 addresses.

Jump to

Keyboard shortcuts

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