nodeinfo

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeLabelOSName           = "feature.node.kubernetes.io/system-os_release.ID"
	NodeLabelOSVer            = "feature.node.kubernetes.io/system-os_release.VERSION_ID"
	NodeLabelKernelVerFull    = "feature.node.kubernetes.io/kernel-version.full"
	NodeLabelHostname         = "kubernetes.io/hostname"
	NodeLabelCPUArch          = "kubernetes.io/arch"
	NodeLabelMlnxNIC          = "feature.node.kubernetes.io/pci-15b3.present"
	NodeLabelNvGPU            = "nvidia.com/gpu.present"
	NodeLabelWaitOFED         = "network.nvidia.com/operator.mofed.wait"
	NodeLabelCudaVersionMajor = "nvidia.com/cuda.driver.major"
)

Node labels used by nodeinfo package

View Source
const (
	// required attrs
	AttrTypeHostname = iota
	AttrTypeCPUArch
	AttrTypeOSName
	AttrTypeOSVer
	// optional attrs
	AttrTypeCudaVersionMajor

	OptionalAttrsStart = AttrTypeCudaVersionMajor
)

Attribute type Enum, add new types before Last and update the mapping below

Variables

View Source
var MellanoxNICListOptions = []client.ListOption{
	client.MatchingLabels{NodeLabelMlnxNIC: "true"}}

MellanoxNICListOptions will match on Mellanox NIC bearing Nodes when queried via k8s client

Functions

This section is empty.

Types

type AttributeType

type AttributeType int

type Filter

type Filter interface {
	// Apply filters a list of nodes according to some internal predicate
	Apply([]*corev1.Node) []*corev1.Node
}

A Filter applies a filter on a list of Nodes

type NodeAttributes

type NodeAttributes struct {
	// Node Name
	Name string
	// Node Attributes
	Attributes map[AttributeType]string
}

NodeAttributes provides attributes of a specific node

type NodeLabelFilterBuilder

type NodeLabelFilterBuilder struct {
	// contains filtered or unexported fields
}

NodeLabelFilterBuilder is a builder for nodeLabelFilter

func NewNodeLabelFilterBuilder

func NewNodeLabelFilterBuilder() *NodeLabelFilterBuilder

NewNodeLabelFilterBuilder returns a new NodeLabelFilterBuilder

func (*NodeLabelFilterBuilder) Build

func (b *NodeLabelFilterBuilder) Build() Filter

Build the Filter

func (*NodeLabelFilterBuilder) Reset

Reset NodeLabelFilterBuilder

func (*NodeLabelFilterBuilder) WithLabel

func (b *NodeLabelFilterBuilder) WithLabel(key, val string) *NodeLabelFilterBuilder

WithLabel adds a label for the Build process of the Label filter

type NodeLabelNoValFilterBuilder added in v0.6.0

type NodeLabelNoValFilterBuilder struct {
	// contains filtered or unexported fields
}

NodeLabelNoValFilterBuilder is a builder for nodeLabelFilter

func NewNodeLabelNoValFilterBuilderr added in v0.6.0

func NewNodeLabelNoValFilterBuilderr() *NodeLabelNoValFilterBuilder

NewNodeLabelNoValFilterBuilderr returns a new NodeLabelNoValFilterBuilder

func (*NodeLabelNoValFilterBuilder) Build added in v0.6.0

Build the Filter

func (*NodeLabelNoValFilterBuilder) Reset added in v0.6.0

Reset NodeLabelNoValFilterBuilder

func (*NodeLabelNoValFilterBuilder) WithLabel added in v0.6.0

WithLabel adds a label for the Build process of the Label filter

type Provider

type Provider interface {
	// GetNodesAttributes retrieves node attributes for nodes matching the filter criteria
	GetNodesAttributes(filters ...Filter) []NodeAttributes
}

Provider provides Node attributes

func NewProvider

func NewProvider(nodeList []*corev1.Node) Provider

NewProvider creates a new Provider object

Jump to

Keyboard shortcuts

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