Documentation ¶
Index ¶
Constants ¶
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
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 ¶
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 ¶
func (b *NodeLabelFilterBuilder) Reset() *NodeLabelFilterBuilder
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
func (b *NodeLabelNoValFilterBuilder) Build() Filter
Build the Filter
func (*NodeLabelNoValFilterBuilder) Reset ¶ added in v0.6.0
func (b *NodeLabelNoValFilterBuilder) Reset() *NodeLabelNoValFilterBuilder
Reset NodeLabelNoValFilterBuilder
func (*NodeLabelNoValFilterBuilder) WithLabel ¶ added in v0.6.0
func (b *NodeLabelNoValFilterBuilder) WithLabel(key string) *NodeLabelNoValFilterBuilder
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 ¶
NewProvider creates a new Provider object