Class NodeDefinition
Describes a cluster node.
Namespace: Neon.Kube.ClusterDef
Assembly: Neon.Kube.dll
Syntax
public class NodeDefinition
Constructors
NodeDefinition()
Constructor.
Declaration
public NodeDefinition()
Properties
Address
The node's IP address or null
if one has not been assigned yet.
Note that an node's IP address cannot be changed once the node has
been added to the cluster.
Declaration
[JsonProperty(PropertyName = "Address", Required = Required.Default)]
[YamlMember(Alias = "address", ApplyNamingConventions = false)]
public string Address { get; set; }
Property Value
Type | Description |
---|---|
string |
Aws
AWS provisioning options for this node, or null
to use reasonable defaults.
Declaration
[JsonProperty(PropertyName = "Aws", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "aws", ApplyNamingConventions = false)]
public AwsNodeOptions Aws { get; set; }
Property Value
Type | Description |
---|---|
AwsNodeOptions |
Azure
Azure provisioning options for this node, or null
to use reasonable defaults.
Declaration
[JsonProperty(PropertyName = "Azure", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "azure", ApplyNamingConventions = false)]
public AzureNodeOptions Azure { get; set; }
Property Value
Type | Description |
---|---|
AzureNodeOptions |
Hypervisor
Hypervisor hosting related options for environments like Hyper-V and XenServer.
Declaration
[JsonProperty(PropertyName = "Hypervisor", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "hypervisor", ApplyNamingConventions = false)]
public HypervisorNodeOptions Hypervisor { get; set; }
Property Value
Type | Description |
---|---|
HypervisorNodeOptions |
Ingress
Indicates whether this node should be configured to accept external network traffic
on node ports and route that into the cluster. This defaults to false
.
note
If all nodes have Ingress set to false
and the cluster defines
one or more IngressRules then NEONKUBE will choose a
reasonable set of nodes to accept inbound traffic.
Declaration
[JsonProperty(PropertyName = "Ingress", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "ingress", ApplyNamingConventions = false)]
public bool Ingress { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsControlPane
Indicates that the node will act as a control-plane node (defaults to false
).
Declaration
[JsonIgnore]
[YamlIgnore]
public bool IsControlPane { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Control-plane nodes are reponsible for managing service discovery and coordinating pod deployment across the cluster.
An odd number of control-plane nodes must be deployed in a cluster (to help prevent split-brain). One control-plane node may be deployed for non-production environments, but to enable high-availability, three or five control-plane nodes may be deployed.
IsWorker
Returns true
for worker nodes.
Declaration
[JsonIgnore]
[YamlIgnore]
public bool IsWorker { get; }
Property Value
Type | Description |
---|---|
bool |
Labels
Specifies the labels to be assigned to the cluster node. These can describe details such as the host CPU, RAM, storage, etc. NodeLabels for more information.
Declaration
[JsonProperty(PropertyName = "Labels", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "labels", ApplyNamingConventions = false)]
public NodeLabels Labels { get; set; }
Property Value
Type | Description |
---|---|
NodeLabels |
Name
Uniquely identifies the node within the cluster.
Declaration
[JsonProperty(PropertyName = "Name", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "name", ApplyNamingConventions = false)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
note
The name may include only letters, numbers, periods, dashes, and underscores and also that all names will be converted to lowercase.
OpenEbsStorage
Indicates that this node will provide a cStor block device for the cStorPool
maintained by the cluster OpenEBS service that provides cloud optimized storage.
This defaults to false
note
If all nodes have OpenEbsStorage set to false
then most NEONKUBE
hosting managers will automatically choose the nodes that will host the cStor
block devices by configuring up to three nodes to do this, favoring worker nodes
over control-plane nodes when possible.
note
The BareMetal hosting manager works a bit differently
from the others. It requires that at least one node have OpenEbsStorage=true
and that node must have an empty unpartitioned block device available to be provisoned
as an cStor.
Declaration
[JsonProperty(PropertyName = "OpenEbsStorage", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "openEbsStorage", ApplyNamingConventions = false)]
public bool OpenEbsStorage { get; set; }
Property Value
Type | Description |
---|---|
bool |
Role
Declaration
[JsonProperty(PropertyName = "Role", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "role", ApplyNamingConventions = false)]
public string Role { get; set; }
Property Value
Type | Description |
---|---|
string |
Taints
Specifies the taints to be assigned to the cluster node.
Declaration
[JsonProperty(PropertyName = "Taints")]
[YamlMember(Alias = "taints", ApplyNamingConventions = false)]
public List<V1Taint> Taints { get; set; }
Property Value
Type | Description |
---|---|
List<V1Taint> |
Methods
GetDataDiskSize(ClusterDefinition)
Returns the size of the data disk as a string with optional ByteUnits unit suffix.
Declaration
public string GetDataDiskSize(ClusterDefinition clusterDefinition)
Parameters
Type | Name | Description |
---|---|---|
ClusterDefinition | clusterDefinition | The cluster definition. |
Returns
Type | Description |
---|---|
string | The disk size or |
GetOsDiskSize(ClusterDefinition)
Returns the size of the operating system boot disk as a string with optional ByteUnits unit suffix.
Declaration
public string GetOsDiskSize(ClusterDefinition clusterDefinition)
Parameters
Type | Name | Description |
---|---|---|
ClusterDefinition | clusterDefinition | The cluster definition. |
Returns
Type | Description |
---|---|
string | The disk size. |
ParseFromLabels(Dictionary<string, string>)
Parses a NodeDefinition from Kubernetes node labels.
Declaration
public static NodeDefinition ParseFromLabels(Dictionary<string, string> labels)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, string> | labels | The node labels. |
Returns
Type | Description |
---|---|
NodeDefinition | The parsed NodeDefinition. |
Validate(ClusterDefinition)
Validates the node definition.
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. |