Class NodeLabels
Describes the standard cluster and custom labels to be assigned to a cluster node.
Namespace: Neon.Kube.ClusterDef
Assembly: Neon.Kube.dll
Syntax
public class NodeLabels
Remarks
Labels are name/value properties that can be assigned to the cluster nodes for pod scheduling and other purposes.
By convention, label names should use a reverse domain name prefix using a DNS domain you control. For example, neonCLUSTER cluster related labels are prefixed with "neonkube.io/...". You should follow this convention for any custom labels you define.
note
You may specify labels without a domain prefix if you're not concerned about potential conflicts.
Label names must begin and end with a letter or digit and may include letters, digits, dashes and dots within. Dots or dashes must not appear consecutively.
note
Whitespace is not allowed in label values.
This class exposes several built-in cluster properties. You can use the Custom dictionary to add your own labels.
Constructors
NodeLabels()
Default constructor.
Declaration
public NodeLabels()
NodeLabels(NodeDefinition)
Constructor.
Declaration
public NodeLabels(NodeDefinition node)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeDefinition | node | The node definition. |
Fields
LabelAddress
Reserved label name that identifies the node's private IP address.
Declaration
public const string LabelAddress = "node.neonkube.io/address"
Field Value
| Type | Description |
|---|---|
| string |
LabelIngress
Reserved label name used to indicate that a node should route external traffic into the cluster.
Declaration
public const string LabelIngress = "node.neonkube.io/system.ingress"
Field Value
| Type | Description |
|---|---|
| string |
LabelIstio
Reserved label name for Istio.
Declaration
public const string LabelIstio = "node.neonkube.io/system.istio"
Field Value
| Type | Description |
|---|---|
| string |
LabelLogs
Reserved label name for Logs.
Declaration
public const string LabelLogs = "node.neonkube.io/monitor.logs"
Field Value
| Type | Description |
|---|---|
| string |
LabelLogsInternal
Reserved label name for LogsInternal.
Declaration
public const string LabelLogsInternal = "node.neonkube.io/monitor.logs-internal"
Field Value
| Type | Description |
|---|---|
| string |
LabelMetrics
Reserved label name for Metrics.
Declaration
public const string LabelMetrics = "node.neonkube.io/monitor.metrics"
Field Value
| Type | Description |
|---|---|
| string |
LabelMetricsInternal
Reserved label name for MetricsInternal.
Declaration
public const string LabelMetricsInternal = "node.neonkube.io/monitor.metrics-internal"
Field Value
| Type | Description |
|---|---|
| string |
LabelMinio
Reserved label name for Minio.
Declaration
public const string LabelMinio = "node.neonkube.io/system.minio"
Field Value
| Type | Description |
|---|---|
| string |
LabelMinioInternal
Reserved label name for MinioInternal.
Declaration
public const string LabelMinioInternal = "node.neonkube.io/system.minio-internal"
Field Value
| Type | Description |
|---|---|
| string |
LabelNeonSystem
Reserved label name for core NEONKUBE system components.
Declaration
public const string LabelNeonSystem = "node.neonkube.io/system"
Field Value
| Type | Description |
|---|---|
| string |
LabelNeonSystemDb
Reserved label name for LabelNeonSystemDb.
Declaration
public const string LabelNeonSystemDb = "node.neonkube.io/system.db"
Field Value
| Type | Description |
|---|---|
| string |
LabelNeonSystemRegistry
Reserved label name for LabelNeonSystemDb.
Declaration
public const string LabelNeonSystemRegistry = "node.neonkube.io/system.registry"
Field Value
| Type | Description |
|---|---|
| string |
LabelOpenEbs
Reserved label name used to indicate that a node hosts an OpenEBS cStor block device.
Declaration
public const string LabelOpenEbs = "node.neonkube.io/system.openebs"
Field Value
| Type | Description |
|---|---|
| string |
LabelPhysicalAvailabilitytSet
Reserved label name for PhysicalAvailabilitySet.
Declaration
public const string LabelPhysicalAvailabilitytSet = "node.neonkube.io/physical.availability-set"
Field Value
| Type | Description |
|---|---|
| string |
LabelPhysicalLocation
Reserved label name for LabelPhysicalPower.
Declaration
public const string LabelPhysicalLocation = "node.neonkube.io/physical.location"
Field Value
| Type | Description |
|---|---|
| string |
LabelPhysicalMachine
Reserved label name for LabelPhysicalMachine.
Declaration
public const string LabelPhysicalMachine = "node.neonkube.io/physical.machine"
Field Value
| Type | Description |
|---|---|
| string |
LabelPhysicalPower
Reserved label name for LabelPhysicalPower.
Declaration
public const string LabelPhysicalPower = "node.neonkube.io/physical.power"
Field Value
| Type | Description |
|---|---|
| string |
LabelRole
Reserved label name that identifies the node role.
Declaration
public const string LabelRole = "node.neonkube.io/role"
Field Value
| Type | Description |
|---|---|
| string |
LabelStorageOSDiskEphemeral
Reserved label name for StorageOSDiskEphemeral.
Declaration
public const string LabelStorageOSDiskEphemeral = "node.neonkube.io/storage.osdisk.ephemeral"
Field Value
| Type | Description |
|---|---|
| string |
LabelStorageOSDiskHDD
Reserved label name for StorageOSDiskHDD.
Declaration
public const string LabelStorageOSDiskHDD = "node.neonkube.io/storage.osdisk.hdd"
Field Value
| Type | Description |
|---|---|
| string |
LabelStorageOSDiskLocal
Reserved label name for StorageOSDiskLocal.
Declaration
public const string LabelStorageOSDiskLocal = "node.neonkube.io/storage.osdisk.local"
Field Value
| Type | Description |
|---|---|
| string |
LabelStorageOSDiskRedundant
Reserved label name for StorageOSDiskRedundant.
Declaration
public const string LabelStorageOSDiskRedundant = "node.neonkube.io/storage.osdisk.redundant"
Field Value
| Type | Description |
|---|---|
| string |
LabelStorageOSDiskSize
Reserved label name for StorageOSDiskSize.
Declaration
public const string LabelStorageOSDiskSize = "node.neonkube.io/storage.osdisk.size"
Field Value
| Type | Description |
|---|---|
| string |
LabelTraces
Reserved label name for Traces.
Declaration
public const string LabelTraces = "node.neonkube.io/monitor.traces"
Field Value
| Type | Description |
|---|---|
| string |
LabelTracesInternal
Reserved label name for TracesInternal.
Declaration
public const string LabelTracesInternal = "node.neonkube.io/monitor.traces-internal"
Field Value
| Type | Description |
|---|---|
| string |
Properties
All
Enumerates all node labels.
Declaration
[JsonIgnore]
[YamlIgnore]
public IEnumerable<KeyValuePair<string, object>> All { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<KeyValuePair<string, object>> |
Custom
Custom node labels.
Declaration
[JsonProperty(PropertyName = "Custom")]
[YamlMember(Alias = "custom", ApplyNamingConventions = false)]
public Dictionary<string, string> Custom { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> |
Remarks
Use this property to define custom cluster node labels.
note
The node.neonkube.io/ label prefix is reserved.
Istio
node.neonkube.io/istio.enabled [bool]: Indicates that Istio
will be deployed to this node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "Istio", Required = Required.Default)]
[YamlMember(Alias = "istio", ApplyNamingConventions = false)]
public bool Istio { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Logs
node.neonkube.io/monitor.logs [bool]: Indicates the user has
specified that Loki logging should be deployed to the labeled node. This
defaults to false.
Declaration
[JsonProperty(PropertyName = "Logs", Required = Required.Default)]
[YamlMember(Alias = "logs", ApplyNamingConventions = false)]
public bool Logs { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LogsInternal
node.neonkube.io/monitor.logs-internal [bool]: Indicates that Liko
logging will be deployed to the labeled node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "LogsInternal", Required = Required.Default)]
[YamlMember(Alias = "logsInternal", ApplyNamingConventions = false)]
public bool LogsInternal { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Metrics
node.neonkube.io/monitor.metrics [bool]: Indicates the user has specified
that Mimir metrics should be deployed to the labeled node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "Metrics", Required = Required.Default)]
[YamlMember(Alias = "metrics", ApplyNamingConventions = false)]
public bool Metrics { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MetricsInternal
node.neonkube.io/monitor.metrics-internal [bool]: Indicates that Mirmir
metrics will be deployed to the labeled node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "MetricsInternal", Required = Required.Default)]
[YamlMember(Alias = "metricsInternal", ApplyNamingConventions = false)]
public bool MetricsInternal { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Minio
node.neonkube.io/system.minio-internal [bool]: Indicates the user has specified
that Minio should be deployed to the labeled node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "Minio", Required = Required.Default)]
[YamlMember(Alias = "minio", ApplyNamingConventions = false)]
public bool Minio { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MinioInternal
node.neonkube.io/system.minio-internal [bool]: Indicates that Minio
will be deployed to the labeled node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "MinioInternal", Required = Required.Default)]
[YamlMember(Alias = "minioInternal", ApplyNamingConventions = false)]
public bool MinioInternal { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
NeonSystem
node.neonkube.io/neon-system [bool]: Indicates that general neon-system
services may be deployed to this node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "NeonSystem", Required = Required.Default)]
[YamlMember(Alias = "neonSystem", ApplyNamingConventions = false)]
public bool NeonSystem { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
NeonSystemDb
node.neonkube.io/neon-system.db [bool]: Indicates that the neon-system
Citus/Postgresql database may be deployed to this node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "NeonSystemDb", Required = Required.Default)]
[YamlMember(Alias = "neonSystemDb", ApplyNamingConventions = false)]
public bool NeonSystemDb { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
NeonSystemRegistry
node.neonkube.io/neon-system.registry [bool]: Indicates that the neon-system
Harbor registry may be deployed to this node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "NeonSystemRegistry", Required = Required.Default)]
[YamlMember(Alias = "neonSystemRegistry", ApplyNamingConventions = false)]
public bool NeonSystemRegistry { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
OpenEbs
node.neonkube.io/openEbs.enabled [bool]: Indicates that OpenEBS
will be deployed to this node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "OpenEbs", Required = Required.Default)]
[YamlMember(Alias = "openEbs", ApplyNamingConventions = false)]
public bool OpenEbs { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
PhysicalAvailabilitySet
node.neonkube.io/physical.availability-set [string]: Indicates that
the hosting environment will try to ensure that cluster VMs with the same
availability set are deployed in a manner that reduces the possibility that
more than one VM at a time will be taken offline for maintenance.
This defaults to control-plane for cluster control-plane nodes and worker for worker nodes.
note
IMPORTANT: Control-plane nodes should generally be located within their own availability set.
Declaration
[JsonProperty(PropertyName = "PhysicalAvailabilitySet", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "physicalAvailabilitySet", ApplyNamingConventions = false)]
public string PhysicalAvailabilitySet { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
This is typcally used for distributing pods across cluster nodes to protect against more than one of them going down at once due to scheduled maintenance.
On premise deployments don't currently support automatic provisioning by availability sets but that may happen in the future (e.g. by managing clusters of XenServer host machines). You'll need to manually specify these labels to match your deployment and maintenance policies.
Cloud deployments generally implement the concept of availability sets. These are used to group VMs together such that only one will be down for scheduled maintenance at any given moment and also that after a reboot, there will be a reasonable delay (like 30 minutes) to allow the VMs to collectively recover before rebooting the next VM. NEONKUBE will provision node VMs that have the same PhysicalAvailabilitySet into the same cloud availability set (for clouds that support this).
PhysicalLocation
node.neonkube.io/physical.location [string]: A free format string describing the
physical location of the server. This defaults to the
empty string.
Declaration
[JsonProperty(PropertyName = "PhysicalLocation", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "physicalLocation", ApplyNamingConventions = false)]
public string PhysicalLocation { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
You should use a consistent convention to describe a physical machine location. Here are some examples:
- rack-slot
- rack-number/rack-slot
- row/rack-number/rack-slot
- floor/row/rack-number/rack-slot
- building/floor/row/rack-number/rack-slot
PhysicalMachine
node.neonkube.io/physical.model [string]: A free format string describing the
physical server computer model (e.g. Dell-PowerEdge-R220). This defaults to the empty string.
Declaration
[JsonProperty(PropertyName = "PhysicalMachine", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "physicalMachine", ApplyNamingConventions = false)]
public string PhysicalMachine { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
PhysicalPower
node.neonkube.io/physical.power [string]: Describes the physical power
connection for the node. This defaults to the empty string.
Declaration
[JsonProperty(PropertyName = "PhysicalPower", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "physicalPower", ApplyNamingConventions = false)]
public string PhysicalPower { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
note
The format for this property is not currently defined.
This field includes the information required to remotely control the power to the physical host machine via a Power Distribution Unit (PDU).
Standard
Enumerates the standard Kubernetes/NEONKUBE node labels.
Declaration
[JsonIgnore]
[YamlIgnore]
public IEnumerable<KeyValuePair<string, object>> Standard { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<KeyValuePair<string, object>> |
StorageOSDiskEphemeral
node.neonkube.io/storage.osdisk.redundant [bool]: Indicates that the storage is ephemeral.
All data will be lost when the host is restarted. This defaults to false for
on-premise clusters and is computed for cloud deployments.
Declaration
[JsonProperty(PropertyName = "StorageOSDiskEphemeral", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "storageOSDiskEphemeral", ApplyNamingConventions = false)]
public bool StorageOSDiskEphemeral { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
StorageOSDiskHDD
node.neonkube.io/storage.osdisk.hdd [bool]: Indicates that the storage
is backed by a spinning drive as opposed to a SSD. This defaults to false for
on-premise clusters and is computed for cloud deployments.
Declaration
[JsonProperty(PropertyName = "StorageOSDiskHDD", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "storageOSDiskHDD", ApplyNamingConventions = false)]
public bool StorageOSDiskHDD { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
StorageOSDiskLocal
node.neonkube.io/storage.osdisklocal [bool]: Specifies whether the node storage is hosted
on the node itself or is mounted as a remote file system or block device. This defaults
to true for on-premise clusters and is computed for cloud deployments.
Declaration
[JsonProperty(PropertyName = "StorageOSDiskLocal", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "storageOSDiskLocal", ApplyNamingConventions = false)]
public bool StorageOSDiskLocal { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
StorageOSDiskRedundant
node.neonkube.io/storage.osdisk.redundant [bool]: Indicates that the storage is redundant. This
may be implemented locally using RAID1+ or remotely using network or cloud-based file systems.
This defaults to false for on-premise clusters and is computed for cloud deployments.
Declaration
[JsonProperty(PropertyName = "StorageOSDiskRedundant", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "storageOSDiskRedundant", ApplyNamingConventions = false)]
public bool StorageOSDiskRedundant { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
StorageOSDiskSize
node.neonkube.io/storage.osdisk.size [string]: Specifies the node OS drive
storage capacity in bytes.
Declaration
[JsonProperty(PropertyName = "StorageOSDiskSize", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.Include)]
[YamlMember(Alias = "storageOSDiskSize", ApplyNamingConventions = false)]
public string StorageOSDiskSize { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Traces
node.neonkube.io/monitor.traces [bool]: Indicates the user has specified
that Tempo traces should be deployed to the labeled node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "Traces", Required = Required.Default)]
[YamlMember(Alias = "traces", ApplyNamingConventions = false)]
public bool Traces { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
TracesInternal
node.neonkube.io/monitor.traces-internal [bool]: Indicates that Tempo
traces will be deployed to the labeled node. This defaults to false.
Declaration
[JsonProperty(PropertyName = "TracesInternal", Required = Required.Default)]
[YamlMember(Alias = "tracesInternal", ApplyNamingConventions = false)]
public bool TracesInternal { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Validate(ClusterDefinition)
Validates the node labels.
Declaration
public void Validate(ClusterDefinition clusterDefinition)
Parameters
| Type | Name | Description |
|---|---|---|
| ClusterDefinition | clusterDefinition | The cluster definition. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown if the definition is not valid. |