package node
import "k8s.io/kubernetes/pkg/util/node"
Index ¶
- Constants
- func GetNodeHostIPs(node *v1.Node) ([]net.IP, error)
- func GetPreferredNodeAddress(node *v1.Node, preferredAddressTypes []v1.NodeAddressType) (string, error)
- func IsNodeReady(node *v1.Node) bool
- type NoMatchError
Constants ¶
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" )
Functions ¶
func GetNodeHostIPs ¶
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 GetPreferredNodeAddress ¶
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 IsNodeReady ¶
IsNodeReady returns true if a node is ready; false otherwise.
Types ¶
type NoMatchError ¶
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 ¶
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.
Source Files ¶
node.go
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 3 hours ago –
Tools for package owners.