v1alpha1

package
v0.0.0-...-35294a0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FeatureLabelNs is the (default) namespace for feature labels.
	FeatureLabelNs = "feature.node.kubernetes.io"

	// FeatureLabelSubNsSuffix is the suffix for allowed feature label sub-namespaces.
	FeatureLabelSubNsSuffix = "." + FeatureLabelNs

	// ProfileLabelNs is the namespace for profile labels.
	ProfileLabelNs = "profile.node.kubernetes.io"

	// ProfileLabelSubNsSuffix is the suffix for allowed profile label sub-namespaces.
	ProfileLabelSubNsSuffix = "." + ProfileLabelNs

	// TaintNs is the k8s.io namespace that can be used for NFD-managed taints.
	TaintNs = "feature.node.kubernetes.io"

	// TaintSubNsSuffix is the suffix for allowed sub-namespaces for NFD-managed taints.
	TaintSubNsSuffix = "." + TaintNs

	// AnnotationNs namespace for all NFD-related annotations.
	AnnotationNs = "nfd.node.kubernetes.io"

	// ExtendedResourceNs is the namespace for extended resources.
	ExtendedResourceNs = "feature.node.kubernetes.io"

	// ExtendedResourceSubNsSuffix is the suffix for allowed extended resources sub-namespaces.
	ExtendedResourceSubNsSuffix = "." + ExtendedResourceNs

	// ExtendedResourceAnnotation is the annotation that holds all extended resources managed by NFD.
	ExtendedResourceAnnotation = AnnotationNs + "/extended-resources"

	// FeatureLabelsAnnotation is the annotation that holds all feature labels managed by NFD.
	FeatureLabelsAnnotation = AnnotationNs + "/feature-labels"

	// MasterVersionAnnotation is the annotation that holds the version of nfd-master running on the node
	// DEPRECATED: will not be used in NFD v0.15 or later.
	MasterVersionAnnotation = AnnotationNs + "/master.version"

	// WorkerVersionAnnotation is the annotation that holds the version of nfd-worker running on the node
	WorkerVersionAnnotation = AnnotationNs + "/worker.version"

	// NodeTaintsAnnotation is the annotation that holds the taints that nfd-master set on the node
	NodeTaintsAnnotation = AnnotationNs + "/taints"

	// FeatureAnnotationsTrackingAnnotation is the annotation that holds all feature annotations that nfd-master set on the node
	FeatureAnnotationsTrackingAnnotation = AnnotationNs + "/feature-annotations"

	// NodeFeatureObjNodeNameLabel is the label that specifies which node the
	// NodeFeature object is targeting. Creators of NodeFeature objects must
	// set this label and consumers of the objects are supposed to use the
	// label for filtering features designated for a certain node.
	NodeFeatureObjNodeNameLabel = "nfd.node.kubernetes.io/node-name"

	// FeatureAnnotationNs is the (default) namespace for feature annotations.
	FeatureAnnotationNs = "feature.node.kubernetes.io"

	// FeatureAnnotationSubNsSuffix is the suffix for allowed feature annotation sub-namespaces.
	FeatureAnnotationSubNsSuffix = "." + FeatureAnnotationNs
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeFeatureSet

type AttributeFeatureSet struct {
	Elements map[string]string `json:"elements" protobuf:"bytes,1,rep,name=elements"`
}

AttributeFeatureSet is a set of features having string value.

func NewAttributeFeatures

func NewAttributeFeatures(values map[string]string) AttributeFeatureSet

NewAttributeFeatures creates a new instance of ValueFeatureSet.

type Features

type Features struct {
	// Flags contains all the flag-type features of the node.
	// +optional
	Flags map[string]FlagFeatureSet `json:"flags" protobuf:"bytes,1,rep,name=flags"`
	// Attributes contains all the attribute-type features of the node.
	// +optional
	Attributes map[string]AttributeFeatureSet `json:"attributes" protobuf:"bytes,2,rep,name=vattributes"`
	// Instances contains all the instance-type features of the node.
	// +optional
	Instances map[string]InstanceFeatureSet `json:"instances" protobuf:"bytes,3,rep,name=instances"`
}

Features is the collection of all discovered features.

func NewFeatures

func NewFeatures() *Features

NewFeatures creates a new instance of Features, initializing all feature types (flags, attributes and instances) to empty values.

func (*Features) Exists

func (f *Features) Exists(name string) string

Exists returns a non-empty string if a feature exists. The return value is the type of the feautre, i.e. "flag", "attribute" or "instance".

func (*Features) InsertAttributeFeatures

func (f *Features) InsertAttributeFeatures(domain, feature string, values map[string]string)

InsertAttributeFeatures inserts new values into a specific feature.

type FlagFeatureSet

type FlagFeatureSet struct {
	Elements map[string]Nil `json:"elements" protobuf:"bytes,1,rep,name=elements"`
}

FlagFeatureSet is a set of simple features only containing names without values.

func NewFlagFeatures

func NewFlagFeatures(keys ...string) FlagFeatureSet

NewFlagFeatures creates a new instance of KeyFeatureSet.

type InstanceFeature

type InstanceFeature struct {
	Attributes map[string]string `json:"attributes" protobuf:"bytes,1,rep,name=attributes"`
}

InstanceFeature represents one instance of a complex features, e.g. a device.

func NewInstanceFeature

func NewInstanceFeature(attrs map[string]string) *InstanceFeature

NewInstanceFeature creates a new InstanceFeature instance.

type InstanceFeatureSet

type InstanceFeatureSet struct {
	Elements []InstanceFeature `json:"elements" protobuf:"bytes,1,rep,name=elements"`
}

InstanceFeatureSet is a set of features each of which is an instance having multiple attributes.

func NewInstanceFeatures

func NewInstanceFeatures(instances []InstanceFeature) InstanceFeatureSet

NewInstanceFeatures creates a new instance of InstanceFeatureSet.

type Nil

type Nil struct{}

Nil is a dummy empty struct for protobuf compatibility

Jump to

Keyboard shortcuts

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