kubernetes: k8s.io/kubernetes/test/e2e/framework/node Index | Files

package node

import "k8s.io/kubernetes/test/e2e/framework/node"

Index

Package Files

resource.go wait.go

func CheckReady Uses

func CheckReady(c clientset.Interface, size int, timeout time.Duration) ([]v1.Node, error)

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 Nodes excluding Master Node.

func CheckReadyForTests Uses

func CheckReadyForTests(c clientset.Interface, nonblockingTaints string, allowedNotReadyNodes, largeClusterThreshold int) func() (bool, error)

CheckReadyForTests returns a method usable in polling methods which will check that the nodes are in a testable state based on schedulability.

func CollectAddresses Uses

func CollectAddresses(nodes *v1.NodeList, addressType v1.NodeAddressType) []string

CollectAddresses returns a list of addresses of the given addressType for the given list of nodes

func Filter Uses

func Filter(nodeList *v1.NodeList, fn func(node v1.Node) bool)

Filter filters nodes in NodeList in place, removing nodes that do not satisfy the given condition TODO: consider merging with pkg/client/cache.NodeLister

func FirstAddress Uses

func FirstAddress(nodelist *v1.NodeList, addrType v1.NodeAddressType) []string

FirstAddress returns the first address of the given type of each node. TODO: Use return type string instead of []string

func GetAddresses Uses

func GetAddresses(node *v1.Node, addressType v1.NodeAddressType) (ips []string)

GetAddresses returns a list of addresses of the given addressType for the given node

func GetBoundedReadySchedulableNodes Uses

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.

func GetExternalIP Uses

func GetExternalIP(node *v1.Node) (string, error)

GetExternalIP returns node external IP concatenated with port 22 for ssh e.g. 1.2.3.4:22

func GetInternalIP Uses

func GetInternalIP(node *v1.Node) (string, error)

GetInternalIP returns node internal IP

func GetMasterAndWorkerNodes Uses

func GetMasterAndWorkerNodes(c clientset.Interface) (sets.String, *v1.NodeList, error)

GetMasterAndWorkerNodes will return a list masters and schedulable worker nodes

func GetPortURL Uses

func GetPortURL(client clientset.Interface, ns, name string, svcPort int) (string, error)

GetPortURL returns the url to a nodeport Service.

func GetPublicIps Uses

func GetPublicIps(c clientset.Interface) ([]string, error)

GetPublicIps returns a public IP list of nodes.

func GetRandomReadySchedulableNode Uses

func GetRandomReadySchedulableNode(c clientset.Interface) (*v1.Node, error)

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.

func GetReadyNodesIncludingTainted Uses

func GetReadyNodesIncludingTainted(c clientset.Interface) (nodes *v1.NodeList, err 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

func GetReadySchedulableNodes Uses

func GetReadySchedulableNodes(c clientset.Interface) (nodes *v1.NodeList, err error)

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. TODO: remove references in framework/util.go.

func IsConditionSetAsExpected Uses

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 Uses

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.

func IsConditionUnset Uses

func IsConditionUnset(node *v1.Node, conditionType v1.NodeConditionType) bool

IsConditionUnset returns true if conditions of the given node do not have a match to the given conditionType, otherwise false.

func IsNodeReady Uses

func IsNodeReady(node *v1.Node) bool

IsNodeReady returns true if: 1) it's Ready condition is set to true 2) doesn't have NetworkUnavailable condition set to true

func IsNodeSchedulable Uses

func IsNodeSchedulable(node *v1.Node) bool

IsNodeSchedulable returns true if: 1) doesn't have "unschedulable" field set 2) it also returns true from IsNodeReady

func IsNodeUntainted Uses

func IsNodeUntainted(node *v1.Node) bool

IsNodeUntainted tests whether a fake pod can be scheduled on "node", given its current taints. TODO: need to discuss wether to return bool and error type

func PickIP Uses

func PickIP(c clientset.Interface) (string, error)

PickIP picks one public node IP

func TotalReady Uses

func TotalReady(c clientset.Interface) (int, error)

TotalReady returns number of ready Nodes excluding Master Node.

func TotalRegistered Uses

func TotalRegistered(c clientset.Interface) (int, error)

TotalRegistered returns number of registered Nodes excluding Master Node.

func WaitConditionToBe Uses

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).

func WaitForNodeToBeNotReady Uses

func WaitForNodeToBeNotReady(c clientset.Interface, name string, timeout time.Duration) bool

WaitForNodeToBeNotReady returns whether node name is not ready (i.e. the readiness condition is anything but ready, e.g false or unknown) within timeout.

func WaitForNodeToBeReady Uses

func WaitForNodeToBeReady(c clientset.Interface, name string, timeout time.Duration) bool

WaitForNodeToBeReady returns whether node name is ready within timeout.

func WaitForReadyNodes Uses

func WaitForReadyNodes(c clientset.Interface, size int, timeout time.Duration) error

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 Nodes excluding Master Node.

func WaitForTotalHealthy Uses

func WaitForTotalHealthy(c clientset.Interface, timeout time.Duration) error

WaitForTotalHealthy checks whether all registered nodes are ready and all required Pods are running on them.

type PodNode Uses

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

func PodNodePairs Uses

func PodNodePairs(c clientset.Interface, ns string) ([]PodNode, error)

PodNodePairs return podNode pairs for all pods in a namespace

Package node imports 18 packages (graph) and is imported by 414 packages. Updated 2019-10-28. Refresh now. Tools for package owners.