nodes

package
v0.0.0-...-729cd59 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerPid

func ContainerPid(ctx context.Context, node *corev1.Node, containerId string) (string, error)

ContainerPid returns container process pid using crictl inspect command

func CpuManagerCpuSet

func CpuManagerCpuSet(ctx context.Context, node *corev1.Node) (cpuset.CPUSet, error)

CpuManagerCpuSet returns cpu manager state file data

func ExecCommand

func ExecCommand(ctx context.Context, node *corev1.Node, command []string) ([]byte, error)

ExecCommand returns the output of the command execution as a []byte

func GetAndRemoveCpuSiblingsFromMap

func GetAndRemoveCpuSiblingsFromMap(numaCoreSiblings map[int]map[int][]int, coreId int) []string

GetAndRemoveCpuSiblingsFromMap function returns the cpus siblings associated with core Also updates the map by deleting the cpu siblings returned

func GetByCpuAllocatable

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

func GetByCpuCapacity

func GetByCpuCapacity(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

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 GetCoreSiblings

func GetCoreSiblings(ctx context.Context, node *corev1.Node) (map[int]map[int][]int, error)

GetCoreSiblings returns the siblings of core per numa node

func GetDefaultSmpAffinityRaw

func GetDefaultSmpAffinityRaw(ctx context.Context, node *corev1.Node) (string, error)

func GetDefaultSmpAffinitySet

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

GetDefaultSmpAffinitySet returns the default smp affinity mask for the node Warning: Please note that default smp affinity mask is not aware

of offline cpus and will return the affinity bits for those
as well. You must intersect the mask with the mask returned
by GetOnlineCPUsSet if this is not desired.

func GetKubeletConfig

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

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

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(ctx context.Context, node *corev1.Node) (map[int][]int, error)

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

func GetNumaRanges

func GetNumaRanges(cpuString string) string

GetNumaRanges function Splits the numa Siblings in to multiple Ranges Example for Cpu Siblings: 10,50,11,51,12,52,13,53,14,54 , will return 10-14,50-54

func GetOnlineCPUsSet

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

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

func GetSMTLevel

func GetSMTLevel(ctx context.Context, 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(ctx context.Context, 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

func WaitForReadyOrFail

func WaitForReadyOrFail(tag, nodeName string, timeout, polling time.Duration)

Types

type ContainerInfo

type ContainerInfo struct {
	PID int `json:"pid"`
}

type CpuManagerStateInfo

type CpuManagerStateInfo struct {
	PolicyName    string `json:"policyName"`
	DefaultCPUSet string `json:"defaultCpuSet"`
	Checksum      int    `json:"checksum"`
}

type CrictlInfo

type CrictlInfo struct {
	Info struct {
		Pid   int `json:"pid"`
		Linux struct {
			Resources struct {
				CPU struct {
					Shares int    `json:"shares"`
					Quota  int    `json:"quota"`
					Period int    `json:"period"`
					Cpus   string `json:"cpus"`
				} `json:"cpus"`
			} `json:"resources"`
			CgroupsPath string `json:"cgroupsPath"`
		} `json:"linux"`
	} `json:"info"`
}

type NodeCPU

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

NodeCPU Structure

type NodeInterface

type NodeInterface struct {
	Name     string
	Physical bool
	UP       bool
	Bridge   bool
	// contains filtered or unexported fields
}

Node Ether/virtual Interface

func GetNodeInterfaces

func GetNodeInterfaces(ctx context.Context, node corev1.Node) ([]NodeInterface, error)

Get Node Ethernet/Virtual Interfaces

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