node

package
v1.21.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 19 Imported by: 1,135

Documentation

Index

Constants

View Source
const (
	// NodeUnreachablePodReason is the reason on a pod when its state cannot be confirmed as kubelet is unresponsive
	// on the node it is (was) running.
	NodeUnreachablePodReason = "NodeLost"
	// NodeUnreachablePodMessage is the message on a pod when its state cannot be confirmed as kubelet is unresponsive
	// on the node it is (was) running.
	NodeUnreachablePodMessage = "Node %v which was running pod %v is unresponsive"
)

Variables

This section is empty.

Functions

func GetHostname

func GetHostname(hostnameOverride string) (string, error)

GetHostname returns OS's hostname if 'hostnameOverride' is empty; otherwise, return 'hostnameOverride'.

func GetNodeHostIP

func GetNodeHostIP(node *v1.Node) (net.IP, error)

GetNodeHostIP returns the provided node's "primary" IP; see GetNodeHostIPs for more details

func GetNodeHostIPs added in v1.20.0

func GetNodeHostIPs(node *v1.Node) ([]net.IP, error)

GetNodeHostIPs returns the provided node's IP(s); either a single "primary IP" for the node in a single-stack cluster, or a dual-stack pair of IPs in a dual-stack cluster (for nodes that actually have dual-stack IPs). Among other things, the IPs returned from this function are used as the `.status.PodIPs` values for host-network pods on the node, and the first IP is used as the `.status.HostIP` for all pods on the node.

func GetNodeIP added in v1.13.0

func GetNodeIP(client clientset.Interface, name string) net.IP

GetNodeIP returns an IP (as with GetNodeHostIP) for the node with the provided name. If required, it will wait for the node to be created.

func GetPreferredNodeAddress added in v1.5.0

func GetPreferredNodeAddress(node *v1.Node, preferredAddressTypes []v1.NodeAddressType) (string, error)

GetPreferredNodeAddress returns the address of the provided node, using the provided preference order. If none of the preferred address types are found, an error is returned.

func PatchNodeCIDR added in v1.8.11

func PatchNodeCIDR(c clientset.Interface, node types.NodeName, cidr string) error

PatchNodeCIDR patches the specified node's CIDR to the given value.

func PatchNodeCIDRs added in v1.16.0

func PatchNodeCIDRs(c clientset.Interface, node types.NodeName, cidrs []string) error

PatchNodeCIDRs patches the specified node.CIDR=cidrs[0] and node.CIDRs to the given value.

func PatchNodeStatus added in v1.6.0

func PatchNodeStatus(c v1core.CoreV1Interface, nodeName types.NodeName, oldNode *v1.Node, newNode *v1.Node) (*v1.Node, []byte, error)

PatchNodeStatus patches node status.

func SetNodeCondition added in v1.4.0

func SetNodeCondition(c clientset.Interface, node types.NodeName, condition v1.NodeCondition) error

SetNodeCondition updates specific node condition with patch operation.

Types

type NoMatchError added in v1.14.0

type NoMatchError struct {
	// contains filtered or unexported fields
}

NoMatchError is a typed implementation of the error interface. It indicates a failure to get a matching Node.

func (*NoMatchError) Error added in v1.14.0

func (e *NoMatchError) Error() string

Error is the implementation of the conventional interface for representing an error condition, with the nil value representing no error.

Jump to

Keyboard shortcuts

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