nodes

package
v0.0.41101 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BannedCPUs

func BannedCPUs(node corev1.Node) (banned cpuset.CPUSet, err error)

func ExecCommandOnMachineConfigDaemon

func ExecCommandOnMachineConfigDaemon(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 ExecCommandOnNode

func ExecCommandOnNode(cmd []string, node *corev1.Node) (string, error)

ExecCommandOnNode executes given command on given node and returns the result

func GetByCpuAllocatable

func GetByCpuAllocatable(nodesList []corev1.Node, cpuQty int) []corev1.Node

func GetByLabels

func GetByLabels(nodeLabels map[string]string) ([]corev1.Node, error)

GetByLabels returns all nodes with the specified labels

func GetByName added in v0.0.41100

func GetByName(nodeName string) (*corev1.Node, error)

GetByName returns a node object by for a node name

func GetByRole

func GetByRole(role string) ([]corev1.Node, error)

GetByRole returns all nodes with the specified role

func GetBySelector

func GetBySelector(selector labels.Selector) ([]corev1.Node, error)

GetBySelector returns all nodes with the specified selector

func GetDefaultSmpAffinitySet

func GetDefaultSmpAffinitySet(node *corev1.Node) (cpuset.CPUSet, error)

GetDefaultSmpAffinitySet returns the default smp affinity mask for the node

func GetKubeletConfig

func GetKubeletConfig(node *corev1.Node) (*kubeletconfigv1beta1.KubeletConfiguration, error)

GetKubeletConfig returns KubeletConfiguration loaded from the node /etc/kubernetes/kubelet.conf

func GetMachineConfigDaemonByNode

func GetMachineConfigDaemonByNode(node *corev1.Node) (*corev1.Pod, error)

GetMachineConfigDaemonByNode returns the machine-config-daemon pod that runs on the specified node

func GetNonPerformancesWorkers

func GetNonPerformancesWorkers(nodeSelectorLabels map[string]string) ([]corev1.Node, error)

GetNonPerformancesWorkers returns list of nodes with non matching perfomance profile labels

func GetNumaNodes

func GetNumaNodes(node *corev1.Node) (map[int][]int, error)

GetNumaNodes returns the number of numa nodes and the associated cpus as list on the node

func GetOnlineCPUsSet

func GetOnlineCPUsSet(node *corev1.Node) (cpuset.CPUSet, error)

GetOnlineCPUsSet returns the list of online (being scheduled) CPUs on the node

func GetSMTLevel

func GetSMTLevel(cpuID int, node *corev1.Node) int

GetSMTLevel returns the SMT level on the node using the given cpuID as target Use a random cpuID from the return value of GetOnlineCPUsSet if not sure

func HasPreemptRTKernel

func HasPreemptRTKernel(node *corev1.Node) error

HasPreemptRTKernel returns no error if the node booted with PREEMPT RT kernel

func MatchingOptionalSelector

func MatchingOptionalSelector(toFilter []corev1.Node) ([]corev1.Node, error)

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" Inspired from: https://github.com/fedepaol/sriov-network-operator/blob/master/test/util/nodes/nodes.go

func TunedForNode

func TunedForNode(node *corev1.Node, sno bool) *corev1.Pod

TunedForNode find tuned pod for appropriate node

Types

type NodeCPU

type NodeCPU struct {
	CPU  string `json:"cpu"`
	Node string `json:"node"`
}

NodeCPU Structure

type NumaNodes

type NumaNodes struct {
	Cpus []NodeCPU `json:"cpus"`
}

NumaNodes defines cpus in each numa node

Jump to

Keyboard shortcuts

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