Documentation ¶
Index ¶
- Variables
- func AddRoleTo(nodeName, role string) error
- func AvailableForSelector(nodeSelector map[string]string) ([]corev1.Node, error)
- func ExecCommandOnMachineConfigDaemon(cs *testclient.ClientSet, node *corev1.Node, command []string) ([]byte, error)
- func FilterByResource(cs *testclient.ClientSet, nodes []corev1.Node, resource corev1.ResourceName) []corev1.Node
- func FindRoleLabel(node *corev1.Node) string
- func GetByRole(cs *testclient.ClientSet, role string) ([]corev1.Node, error)
- func GetKubeletConfig(cs *testclient.ClientSet, node *corev1.Node) (*kubeletconfigv1beta1.KubeletConfiguration, error)
- func GetMachineConfigDaemonByNode(cs *testclient.ClientSet, node *corev1.Node) (*corev1.Pod, error)
- func GetOvnkubePodByNode(cs *testclient.ClientSet, node *corev1.Node) (*corev1.Pod, error)
- func HasSCTPEnabled(node *corev1.Node) (bool, error)
- func HavingSCTPEnabled(inputNodeNames []string) ([]string, error)
- func IsSingleNodeCluster() (bool, error)
- func LabelNode(nodeName, key, value string) (*corev1.Node, error)
- func LabeledNodesCount(label string) (int, error)
- func MatchingCustomSelectorByName(toFilter []string, nodesSelector string) ([]string, error)
- func MatchingOptionalSelector(toFilter []corev1.Node) ([]corev1.Node, error)
- func MatchingOptionalSelectorByName(toFilter []string) ([]string, error)
- func MatchingOptionalSelectorPTP(toFilter []ptpv1.NodePtpDevice) ([]ptpv1.NodePtpDevice, error)
- func PodLabelSelector() (map[string]string, bool)
- func RemoveRoleFrom(nodeName, role string) error
- func SelectorUnion(nodeSelector1 map[string]string, nodeSelector2 map[string]string) map[string]string
- type NodeTopology
Constants ¶
This section is empty.
Variables ¶
var NodesSelector string
NodesSelector represent the label selector used to filter impacted nodes.
Functions ¶
func AvailableForSelector ¶
AvailableForSelector returns nodes available for given nodeSelector
func ExecCommandOnMachineConfigDaemon ¶
func ExecCommandOnMachineConfigDaemon(cs *testclient.ClientSet, node *corev1.Node, command []string) ([]byte, error)
ExecCommandOnMachineConfigDaemon returns the output of the command execution on the machine-config-daemon pod that runs on the specified node
func FilterByResource ¶
func FilterByResource(cs *testclient.ClientSet, nodes []corev1.Node, resource corev1.ResourceName) []corev1.Node
FilterByResource returns all nodes with the specified allocated resource greater than 0
func FindRoleLabel ¶
FindRoleLabel loops over node labels and return the first with key like "node-role.kubernetest.io/*", except "node-role.kubernetest.io/worker".
Consider that a node is suppose to have only one "custom role" (role != "worker"). If a node has two or more custom roles, MachineConfigOperato stops managing that node.
func GetKubeletConfig ¶
func GetKubeletConfig(cs *testclient.ClientSet, node *corev1.Node) (*kubeletconfigv1beta1.KubeletConfiguration, error)
GetKubeletConfig returns KubeletConfiguration loaded from the node /etc/kubernetes/kubelet.conf
func GetMachineConfigDaemonByNode ¶
GetMachineConfigDaemonByNode returns the machine-config-daemon pod that runs on the specified node
func GetOvnkubePodByNode ¶
GetOvsPodByNode returns the ovs-node pod that runs on the specified node
func HavingSCTPEnabled ¶
HavingSCTPEnabled takes a list node names and return the same list with only the nodes that has SCTP enabled.
func IsSingleNodeCluster ¶
func LabeledNodesCount ¶
LabeledNodesCount return the number of nodes with the given label.
func MatchingCustomSelectorByName ¶
MatchingCustomSelectorByName filter the given slice with only the nodes matching the given custom selector. The nodesSelector must be in the form of label=value. For example: nodesSelector="sctp=true"
func MatchingOptionalSelector ¶
MatchingOptionalSelector filter the given slice with only the nodes matching the optional selector. If no selector is set, it returns the same list. The NODES_SELECTOR must be set with a labelselector expression. For example: NODES_SELECTOR="sctp=true"
func MatchingOptionalSelectorByName ¶
MatchingOptionalSelectorByName filter the given slice with only the nodes matching the optional selector. If no selector is set, it returns the same list. The NODES_SELECTOR must be in the form of label=value. For example: NODES_SELECTOR="sctp=true"
func MatchingOptionalSelectorPTP ¶
func MatchingOptionalSelectorPTP(toFilter []ptpv1.NodePtpDevice) ([]ptpv1.NodePtpDevice, error)
MatchingOptionalSelectorPTP filter the given slice with only the nodes matching the optional selector. If no selector is set, it returns the same list. The NODES_SELECTOR must be set with a labelselector expression. For example: NODES_SELECTOR="sctp=true"
func PodLabelSelector ¶
PodLabelSelector returns a map based on the optional NODES_SELECTOR variable.
func RemoveRoleFrom ¶
RemoveRoleFrom removes the "node-role.kubernetes.io/<role>" from the given node
Types ¶
type NodeTopology ¶
NodeTopology represents a subset of the node topology structure.
func PtpEnabled ¶
func PtpEnabled(client *client.ClientSet) ([]NodeTopology, error)
PtpEnabled returns the topology of a given node, filtering using the given selector.