Class KubernetesOptions
Describes the Kubernetes options for a NEONKUBE.
Namespace: Neon.Kube.ClusterDef
Assembly: Neon.Kube.dll
Syntax
public class KubernetesOptions
Constructors
KubernetesOptions()
Default constructor.
Declaration
public KubernetesOptions()
Fields
FeatureGates
Enables or disables specific Kubernetes features. This can be used to enable alpha quality or other features that are disabled by default for the Kubernetes version being deployed or to disable features.
Declaration
[JsonProperty(PropertyName = "FeatureGates", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "featureGates", ApplyNamingConventions = false)]
public Dictionary<string, bool> FeatureGates
Field Value
Type | Description |
---|---|
Dictionary<string, bool> |
Remarks
This is a dictionary that maps feature names a boolean where true
enables the feature and false
disables it. You can find a description
of the available Kubernetes feature gates here:
https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates
note
Your NEONKUBE cluster may be somewhat older than the current Kubernetes version, so some of the features listed may not apply to your cluster.
NEONKUBE clusters enables specific features by default when you you haven't explicitly disabled them via this property. Note that some features are required and cannot be disabled.
EphemeralContainers |
Enables the ability to add ephemeral containers to running pods. This is very handy for debugging pods. |
Properties
AllowPodsOnControlPlane
Enable pods to be scheduled on cluster control-plane nodes. This defaults to null
which will allow pods to be scheduled on control-plane nodes if the cluster consists only of
control-plane nodes (e.g. for a single node cluster. This defaults to false
for
clusters with worker nodes.
Declaration
[JsonProperty(PropertyName = "AllowPodsOnControlPlane", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "allowPodsOnControlPlane", ApplyNamingConventions = false)]
public bool? AllowPodsOnControlPlane { get; set; }
Property Value
Type | Description |
---|---|
bool? |
ApiServer
Specifies the Kubernetes API Server log verbosity. This defaults to 2.
Declaration
[JsonProperty(PropertyName = "ApiServer", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "apiServer", ApplyNamingConventions = false)]
public ApiServerOptions ApiServer { get; set; }
Property Value
Type | Description |
---|---|
ApiServerOptions |
Remarks
Here are the log verbosity levels:
1 | Minimal details |
2 | default: Useful steady state service status and significant changes to the system |
3 | Extended information about changes. |
4 | Debug level verbosity. |
5 | Undefined |
6 | Display requested resources. |
7 | Display HTTP request headers. |
8 | Display HTTP request contents. |
8 | Display HTTP request responses. |
DashboardVersion
The version of Kubernetes dashboard to be installed. This defaults to default which will install the latest tested version of Kubernetes.
Declaration
[JsonProperty(PropertyName = "DashboardVersion", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "dashboardVersion", ApplyNamingConventions = false)]
public string DashboardVersion { get; set; }
Property Value
Type | Description |
---|---|
string |
EvictionHard
A is a map of signal names to quantities that defines hard eviction thresholds. For example: {"memory.available": "300Mi"}. To explicitly disable, pass a 0% or 100% threshold on an arbitrary resource. Default: memory.available: "100Mi" nodefs.available: "10%" nodefs.inodesFree: "5%" imagefs.available: "15%"
Declaration
[JsonProperty(PropertyName = "EvictionHard", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "evictionHard", ApplyNamingConventions = false)]
public Dictionary<string, string> EvictionHard { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
HelmVersion
The version of Helm to be installed. This defaults to default which will install a reasonable version for the Kubernetes release being inbstalled.
Declaration
[JsonProperty(PropertyName = "HelmVersion", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "helmVersion", ApplyNamingConventions = false)]
public string HelmVersion { get; set; }
Property Value
Type | Description |
---|---|
string |
KubeReserved
A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs that describe resources reserved for kubernetes system components. Currently cpu, memory and local storage for root file system are supported. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more details. Default: nil
Declaration
[JsonProperty(PropertyName = "KubeReserved", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "kubeReserved", ApplyNamingConventions = false)]
public Dictionary<string, string> KubeReserved { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
MaxPodsPerNode
The maximum number of Pods that can run on this Kubelet. The value must be a non-negative integer. If DynamicKubeletConfig (deprecated; default off) is on, when dynamically updating this field, consider that changes may cause Pods to fail admission on Kubelet restart, and may change the value reported in Node.Status.Capacity[v1.ResourcePods], thus affecting future scheduling decisions. Increasing this value may also decrease performance, as more Pods can be packed into a single node. Default: 250
Declaration
[JsonProperty(PropertyName = "MaxPodsPerNode", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "maxPodsPerNode", ApplyNamingConventions = false)]
public int MaxPodsPerNode { get; set; }
Property Value
Type | Description |
---|---|
int |
ShutdownGracePeriodCriticalPodsSeconds
Specifies the amount of time that Kubelet running on the cluster nodes will delay node shutdown for critical nodes. This defaults to 120 seconds (2 minutes) and must be less than ShutdownGracePeriodSeconds and not less than 30 seconds.
Declaration
[JsonProperty(PropertyName = "ShutdownGracePeriodCriticalPodsSeconds", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "shutdownGracePeriodCriticalPodsSeconds", ApplyNamingConventions = false)]
public int ShutdownGracePeriodCriticalPodsSeconds { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Here's the Kubernetes documentation for this: https://kubernetes.io/docs/concepts/architecture/nodes/#graceful-node-shutdown
- https://kubernetes.io/docs/concepts/architecture/nodes/#graceful-node-shutdown
- https://kubernetes.io/blog/2021/04/21/graceful-node-shutdown-beta/
- https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration
- https://www.freedesktop.org/wiki/Software/systemd/inhibit/
It appears that when Kubelet detects that the node is being shutdown it tries to gracefully shutdown pods like this:
- Pods are signaled to shutdown in PriorityClass order from lowest priority first, up to but not including critical pods. These pods will be given up to ShutdownGracePeriodSeconds to stop gracefully before they may be forcibly terminated.
- After ShutdownGracePeriodSeconds minus- ShutdownGracePeriodCriticalPodsSeconds has elapsed since Kubelet detected node shutdown or all non-crPriorityClass ordeitical pods have been stopped, Kubelet will start shutting down critical pods in PriorityClass order.
- Kubelet will inhibit the kernel from shutting down the node until all pods have been shutdown or ShutdownGracePeriodSeconds has elapsed. Once either of these conditions are true, Kubelet will release this lock so that the node can continue shutting down.
ShutdownGracePeriodSeconds
Specfies the amount of time Kubelet running on the cluster nodes will delay node shutdown while gracefully terminating pods on the node. This is expressed in seconds and must be greater than zero. This defaults to 360 seconds (65 minutes) and cannot be less than 30 seconds.
Declaration
[JsonProperty(PropertyName = "ShutdownGracePeriodSeconds", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "shutdownGracePeriodSeconds", ApplyNamingConventions = false)]
public int ShutdownGracePeriodSeconds { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Here's the Kubernetes documentation for this: https://kubernetes.io/docs/concepts/architecture/nodes/#graceful-node-shutdown
- https://kubernetes.io/docs/concepts/architecture/nodes/#graceful-node-shutdown
- https://kubernetes.io/blog/2021/04/21/graceful-node-shutdown-beta/
- https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration
- https://www.freedesktop.org/wiki/Software/systemd/inhibit/
It appears that when Kubelet detects that the node is being shutdown it tries to gracefully shutdown pods like this:
- Pods are signaled to shutdown in PriorityClass order from lowest priority first, up to but not including critical pods. These pods will be given up to ShutdownGracePeriodSeconds to stop gracefully before they may be forcibly terminated.
- After ShutdownGracePeriodSeconds minus- ShutdownGracePeriodCriticalPodsSeconds has elapsed since Kubelet detected node shutdown or all non-crPriorityClass ordeitical pods have been stopped, Kubelet will start shutting down critical pods in PriorityClass order.
- Kubelet will inhibit the kernel from shutting down the node until all pods have been shutdown or ShutdownGracePeriodSeconds has elapsed. Once either of these conditions are true, Kubelet will release this lock so that the node can continue shutting down.
SystemReserved
A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs that describe resources reserved for non-kubernetes components. Currently only cpu and memory are supported. See http://kubernetes.io/docs/user-guide/compute-resources for more detail. Default: nil
Declaration
[JsonProperty(PropertyName = "SystemReserved", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "systemReserved", ApplyNamingConventions = false)]
public Dictionary<string, string> SystemReserved { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
Version
The version of Kubernetes to be installed. This defaults to default which will install the latest tested version of Kubernetes. The minimum supported version is 1.13.0.
Declaration
[JsonProperty(PropertyName = "Version", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "version", ApplyNamingConventions = false)]
public string Version { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
ClearSecrets()
Clears any sensitive properties like the Docker registry credentials.
Declaration
public void ClearSecrets()
Validate(ClusterDefinition)
Validates the options and also ensures that all null
properties are
initialized to their default values.
Declaration
public void Validate(ClusterDefinition clusterDefinition)
Parameters
Type | Name | Description |
---|---|---|
ClusterDefinition | clusterDefinition | The cluster definition. |
Exceptions
Type | Condition |
---|---|
ClusterDefinitionException | Thrown if the definition is not valid. |