node

package
v0.0.0-...-0f8ce4c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxLabelsPerNode is the absolute maximum of labels that can be attached to a
	// node.
	MaxLabelsPerNode = 128
)

Variables

View Source
var (

	// ErrLabelEmpty is returned by ValidateLabel if the label key/value is not at
	// least one character long.
	ErrLabelEmpty = fmt.Errorf("empty")
	// ErrLabelTooLong is returned by ValidateLabel if the label key/value is more
	// than 63 characters long.
	ErrLabelTooLong = fmt.Errorf("too long")
	// ErrLabelInvalidFirstCharacter is returned by ValidateLabel if the label
	// key/value contains an invalid character on the first position.
	ErrLabelInvalidFirstCharacter = fmt.Errorf("first character not a letter or number")
	// ErrLabelInvalidLastCharacter is returned by ValidateLabel if the label
	// key/value contains an invalid character on the last position.
	ErrLabelInvalidLastCharacter = fmt.Errorf("last character not a letter or number")
	// ErrLabelInvalidCharacter is returned by ValidateLabel if the label key/value
	// contains an invalid character.
	ErrLabelInvalidCharacter = fmt.Errorf("invalid character")
	ErrLabelEmptyPrefix      = fmt.Errorf("empty prefix")
	ErrLabelInvalidPrefix    = fmt.Errorf("invalid prefix")
)

Functions

func GetNodeLabel

func GetNodeLabel(labels *cpb.NodeLabels, key string) string

GetNodeLabel retrieves a node label by key, returning its value or an empty string if no labels with this key is set on the node.

func ValidateClusterDomain

func ValidateClusterDomain(d string) error

ValidateClusterDomain returns an error if the passed string is not a valid cluster domain.

func ValidateLabelKey

func ValidateLabelKey(v string) error

ValidateLabelKey ensures that a given node label key is valid:

  1. 1 to 63 characters long (inclusive);
  2. Characters are all ASCII a-z A-Z 0-9 '_', '-' or '.';
  3. The first character is ASCII a-z A-Z or 0-9.
  4. The last character is ASCII a-z A-Z or 0-9.
  5. Optional slash-delimited prefix which contains a valid 'DNS subdomain'.

If it's valid, nil is returned. Otherwise, one of ErrLabelEmpty, ErrLabelTooLong, ErrLabelInvalidFirstCharacter or ErrLabelInvalidCharacter is returned.

func ValidateLabelValue

func ValidateLabelValue(v string) error

ValidateLabelValue ensures that a given node label value is valid:

  1. 0 to 63 characters long (inclusive);
  2. Characters are all ASCII a-z A-Z 0-9 '_', '-' or '.';
  3. The first character is ASCII a-z A-Z or 0-9.
  4. The last character is ASCII a-z A-Z or 0-9.

If it's valid, nil is returned. Otherwise, one of ErrLabelTooLong, ErrLabelInvalidFirstCharacter, or ErrLabelInvalidLastCharacter, ErrLabelInvalidCharacter is returned.

Types

type Labels

type Labels map[string]string

Labels on a node, a map from label key to value.

func (Labels) Equals

func (l Labels) Equals(others Labels) bool

Equals returns true if these Labels are equal to some others. Equality is defined by having the same set of keys and corresponding values.

func (Labels) Filter

func (l Labels) Filter(pred func(k, v string) bool) Labels

Filter returns a subset of labels for which pred returns true.

type NetStatus

type NetStatus struct {
	ExternalAddress net.IP
}

NetStatus is the current network status of the host. It will be updated by the network Service whenever the node's network configuration changes. Spurious changes might occur, consumers should ensure that the change that occured is meaningful to them.

Directories

Path Synopsis
abloader
Package allocs contains allocations of various types of identifiers used in a node.
Package allocs contains allocations of various types of identifiers used in a node.
bios_bootcode
genlogo command
cluster
Package cluster implements low-level clustering logic, especially logic regarding to bootstrapping, registering into and joining a cluster.
Package cluster implements low-level clustering logic, especially logic regarding to bootstrapping, registering into and joining a cluster.
consensus/client
package client implements a higher-level client for consensus/etcd that is to be used within the Metropolis node code for unprivileged access (ie.
package client implements a higher-level client for consensus/etcd that is to be used within the Metropolis node code for unprivileged access (ie.
curator
package curator implements the Curator, a service responsible for management of the Metropolis cluster that it is running on.
package curator implements the Curator, a service responsible for management of the Metropolis cluster that it is running on.
devmgr
Package devmgr is the userspace pendant to the kernel device management system.
Package devmgr is the userspace pendant to the kernel device management system.
metrics/fake_exporter command
fake_exporter is a tiny Prometheus-compatible metrics exporter which exports a single metric with a value configured at startup.
fake_exporter is a tiny Prometheus-compatible metrics exporter which exports a single metric with a value configured at startup.
mgmt
Package mgmt implements the node-local management service, a.k.a.
Package mgmt implements the node-local management service, a.k.a.
network/hostsfile
Package hostsfile implements a service which owns and writes all node-local files/interfaces used by the system to resolve the local node's name and the names of other nodes in the cluster:
Package hostsfile implements a service which owns and writes all node-local files/interfaces used by the system to resolve the local node's name and the names of other nodes in the cluster:
network/ipam
Package ipam is just a stub right now which contains a type for describing prefix lists.
Package ipam is just a stub right now which contains a type for describing prefix lists.
network/overlay
Package overlay implements a Cluster Networking mesh service running on all Metropolis nodes.
Package overlay implements a Cluster Networking mesh service running on all Metropolis nodes.
roleserve
Package roleserve implements the roleserver/“Role Server”.
Package roleserve implements the roleserver/“Role Server”.
rpc
time
Package time implements a supervisor runnable which is responsible for keeping both the system clock and the RTC accurate.
Package time implements a supervisor runnable which is responsible for keeping both the system clock and the RTC accurate.
authproxy
Package authproxy implements an authenticating proxy in front of the K8s API server converting Metropolis credentials into authentication headers.
Package authproxy implements an authenticating proxy in front of the K8s API server converting Metropolis credentials into authentication headers.
clusternet
Package clusternet implements a WireGuard-based overlay network for Kubernetes.
Package clusternet implements a WireGuard-based overlay network for Kubernetes.
containerd/cniproxy
Package cni implements an adapter between the go-cni interface and the Monogon gRPC Workload Attachment interface.
Package cni implements an adapter between the go-cni interface and the Monogon gRPC Workload Attachment interface.
hyperkube command
This is the entry point for our multicall Kubernetes binary.
This is the entry point for our multicall Kubernetes binary.
metricsprovider
Package metricsprovider provides a Prometheus registry for code in K8s client-go capable of providing metrics.
Package metricsprovider provides a Prometheus registry for code in K8s client-go capable of providing metrics.
metricsproxy
Package metricsproxy implements an authenticating proxy in front of the K8s controller-manager and scheduler providing unauthenticated access to the metrics via local ports
Package metricsproxy implements an authenticating proxy in front of the K8s controller-manager and scheduler providing unauthenticated access to the metrics via local ports
nfproxy
Package nfproxy is a Kubernetes Service IP proxy based exclusively on the Linux nftables interface.
Package nfproxy is a Kubernetes Service IP proxy based exclusively on the Linux nftables interface.
pki
package pki builds upon osbase/pki/ to provide an etcd-backed implementation of all x509 PKI Certificates/CAs required to run Kubernetes.
package pki builds upon osbase/pki/ to provide an etcd-backed implementation of all x509 PKI Certificates/CAs required to run Kubernetes.
plugins/kvmdevice
Package kvmdevice implements a Kubernetes device plugin for the virtual KVM device.
Package kvmdevice implements a Kubernetes device plugin for the virtual KVM device.
reconciler
The reconciler ensures that a base set of K8s resources is always available in the cluster.
The reconciler ensures that a base set of K8s resources is always available in the cluster.

Jump to

Keyboard shortcuts

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