import "k8s.io/kubernetes/test/e2e/framework/node"
resource.go runtimeclass.go wait.go
AddOrUpdateTaintOnNode adds the given taint to the given node or updates taint.
CheckReady waits up to timeout for cluster to has desired size and there is no not-ready nodes in it. By cluster size we mean number of schedulable Nodes.
func CheckReadyForTests(c clientset.Interface, nonblockingTaints string, allowedNotReadyNodes, largeClusterThreshold int) func() (bool, error)
CheckReadyForTests returns a function which will return 'true' once the number of ready nodes is above the allowedNotReadyNodes threshold (i.e. to be used as a global gate for starting the tests).
CollectAddresses returns a list of addresses of the given addressType for the given list of nodes
func CreatePodsPerNodeForSimpleApp(c clientset.Interface, namespace, appName string, podSpec func(n v1.Node) v1.PodSpec, maxCount int) map[string]string
CreatePodsPerNodeForSimpleApp creates pods w/ labels. Useful for tests which make a bunch of pods w/o any networking.
Filter filters nodes in NodeList in place, removing nodes that do not satisfy the given condition
FirstAddress returns the first address of the given type of each node.
func FirstAddressByTypeAndFamily(nodelist *v1.NodeList, addrType v1.NodeAddressType, family v1.IPFamily) string
FirstAddressByTypeAndFamily returns the first address that matches the given type and family of the list of nodes
GetAddresses returns a list of addresses of the given addressType for the given node
func GetAddressesByTypeAndFamily(node *v1.Node, addressType v1.NodeAddressType, family v1.IPFamily) (ips []string)
GetAddressesByTypeAndFamily returns a list of addresses of the given addressType for the given node and filtered by IPFamily
func GetBoundedReadySchedulableNodes(c clientset.Interface, maxNodes int) (nodes *v1.NodeList, err error)
GetBoundedReadySchedulableNodes is like GetReadySchedulableNodes except that it returns at most maxNodes nodes. Use this to keep your test case from blowing up when run on a large cluster.
GetClusterZones returns the values of zone label collected from all nodes.
GetExternalIP returns node external IP concatenated with port 22 for ssh e.g. 1.2.3.4:22
GetInternalIP returns node internal IP
GetPublicIps returns a public IP list of nodes.
GetRandomReadySchedulableNode gets a single randomly-selected node which is available for running pods on. If there are no available nodes it will return an error.
GetReadyNodesIncludingTainted returns all ready nodes, even those which are tainted. There are cases when we care about tainted nodes E.g. in tests related to nodes with gpu we care about nodes despite presence of nvidia.com/gpu=present:NoSchedule taint
GetReadySchedulableNodes addresses the common use case of getting nodes you can do work on. 1) Needs to be schedulable. 2) Needs to be ready. If EITHER 1 or 2 is not true, most tests will want to ignore the node entirely. If there are no nodes that are both ready and schedulable, this will return an error.
func IsConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
IsConditionSetAsExpected returns a wantTrue value if the node has a match to the conditionType, otherwise returns an opposite value of the wantTrue with detailed logging.
func IsConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
IsConditionSetAsExpectedSilent returns a wantTrue value if the node has a match to the conditionType, otherwise returns an opposite value of the wantTrue.
IsNodeReady returns true if: 1) it's Ready condition is set to true 2) doesn't have NetworkUnavailable condition set to true
IsNodeSchedulable returns true if: 1) doesn't have "unschedulable" field set 2) it also returns true from IsNodeReady
NewRuntimeClassPod returns a test pod with the given runtimeClassName
PickIP picks one public node IP
PreconfiguredRuntimeClassHandler returns configured runtime handler.
RemoveTaintOffNode removes the given taint from the given node.
TotalReady returns number of ready schedulable Nodes.
TotalRegistered returns number of schedulable Nodes.
func WaitConditionToBe(c clientset.Interface, name string, conditionType v1.NodeConditionType, wantTrue bool, timeout time.Duration) bool
WaitConditionToBe returns whether node "name's" condition state matches wantTrue within timeout. If wantTrue is true, it will ensure the node condition status is ConditionTrue; if it's false, it ensures the node condition is in any state other than ConditionTrue (e.g. not true or unknown).
WaitForNodeToBeNotReady returns whether node name is not ready (i.e. the readiness condition is anything but ready, e.g false or unknown) within timeout.
WaitForNodeToBeReady returns whether node name is ready within timeout.
WaitForReadyNodes waits up to timeout for cluster to has desired size and there is no not-ready nodes in it. By cluster size we mean number of schedulable Nodes.
WaitForTotalHealthy checks whether all registered nodes are ready and all required Pods are running on them.
type PodNode struct { // Pod represents pod name Pod string // Node represents node name Node string }
PodNode is a pod-node pair indicating which node a given pod is running on
PodNodePairs return podNode pairs for all pods in a namespace
Package node imports 26 packages (graph) and is imported by 636 packages. Updated 2020-12-07. Refresh now. Tools for package owners.