node

package
v0.0.0-...-bc30bd0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

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"
)
View Source
const (
	// GodelSchedulerNodeAnnotationKey is the annotation key in both Node and CNR api objects,
	// value is the godel scheduler whose node partition contains this node
	GodelSchedulerNodeAnnotationKey = "godel.bytedance.com/scheduler-name"
)

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 IP, based on the priority: 1. NodeInternalIP 2. NodeExternalIP

func GetNodeIP

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

GetNodeIP returns the ip of node with the provided hostname If required, wait for the node to be defined.

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 GetZoneKey

func GetZoneKey(node metav1.Object) string

GetZoneKey is a helper function that builds a string identifier that is unique per failure-zone; it returns empty-string for no zone. Since there are currently two separate zone keys:

  • "failure-domain.beta.kubernetes.io/zone"
  • "topology.kubernetes.io/zone"

GetZoneKey will first check failure-domain.beta.kubernetes.io/zone and if not exists, will then check topology.kubernetes.io/zone

func NodeOfThisScheduler

func NodeOfThisScheduler(annotations map[string]string, schedulerName string) bool

func PatchNodeCIDR

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

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

func PatchNodeCIDRs

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

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

PatchNodeStatus patches node status.

func Scheduable

func Scheduable(node *v1.Node) bool

Scheduable checks if the node is schedulable a node is schedulable only if its condition NodeReady == True

func SetNodeCondition

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

SetNodeCondition updates specific node condition with patch operation.

func Tainted

func Tainted(node *v1.Node) bool

Tainted checks if the node has taints

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.

Jump to

Keyboard shortcuts

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