Class NodegroupOptions
The Nodegroup Options for addNodeGroup() method.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.EKS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class NodegroupOptions : Object, INodegroupOptions
Syntax (vb)
Public Class NodegroupOptions
Inherits Object
Implements INodegroupOptions
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
cluster.AddNodegroupCapacity("extra-ng-spot", new NodegroupOptions {
InstanceTypes = new [] {
new InstanceType("c5.large"),
new InstanceType("c5a.large"),
new InstanceType("c5d.large") },
MinSize = 3,
CapacityType = CapacityType.SPOT
});
Synopsis
Constructors
Nodegroup |
Properties
Ami |
The AMI type for your node group. |
Capacity |
The capacity type of the nodegroup. |
Desired |
The current number of worker nodes that the managed node group should maintain. |
Disk |
The root device disk size (in GiB) for your node group instances. |
Force |
Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. |
Instance |
The instance types to use for your node group. |
Labels | The Kubernetes labels to be applied to the nodes in the node group when they are created. |
Launch |
Launch template specification used for the nodegroup. |
Max |
The maximum number of worker nodes that the managed node group can scale out to. |
Max |
The maximum number of nodes unavailable at once during a version update. |
Max |
The maximum percentage of nodes unavailable during a version update. |
Min |
The minimum number of worker nodes that the managed node group can scale in to. |
Nodegroup |
Name of the Nodegroup. |
Node |
The IAM role to associate with your node group. |
Release |
The AMI version of the Amazon EKS-optimized AMI to use with your node group (for example, |
Remote |
The remote access (SSH) configuration to use with your node group. |
Subnets | The subnets to use for the Auto Scaling group that is created for your node group. |
Tags | The metadata to apply to the node group to assist with categorization and organization. |
Taints | The Kubernetes taints to be applied to the nodes in the node group when they are created. |
Constructors
NodegroupOptions()
public NodegroupOptions()
Properties
AmiType
The AMI type for your node group.
public Nullable<NodegroupAmiType> AmiType { get; set; }
Property Value
System.
Remarks
If you explicitly specify the launchTemplate with custom AMI, do not specify this property, or the node group deployment will fail. In other cases, you will need to specify correct amiType for the nodegroup.
Default: - auto-determined from the instanceTypes property when launchTemplateSpec property is not specified
CapacityType
The capacity type of the nodegroup.
public Nullable<CapacityType> CapacityType { get; set; }
Property Value
System.
Remarks
Default: - ON_DEMAND
DesiredSize
The current number of worker nodes that the managed node group should maintain.
public Nullable<double> DesiredSize { get; set; }
Property Value
System.
Remarks
If not specified,
the nodewgroup will initially create minSize
instances.
Default: 2
DiskSize
The root device disk size (in GiB) for your node group instances.
public Nullable<double> DiskSize { get; set; }
Property Value
System.
Remarks
Default: 20
ForceUpdate
Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue.
public Nullable<bool> ForceUpdate { get; set; }
Property Value
System.
Remarks
If an update fails because pods could not be drained, you can force the update after it fails to terminate the old node whether or not any pods are running on the node.
Default: true
InstanceTypes
The instance types to use for your node group.
public InstanceType[] InstanceTypes { get; set; }
Property Value
Remarks
Default: t3.medium will be used according to the cloudformation document.
Labels
The Kubernetes labels to be applied to the nodes in the node group when they are created.
public IDictionary<string, string> Labels { get; set; }
Property Value
System.
Remarks
Default: - None
LaunchTemplateSpec
Launch template specification used for the nodegroup.
public ILaunchTemplateSpec LaunchTemplateSpec { get; set; }
Property Value
Remarks
Default: - no launch template
See: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html
MaxSize
The maximum number of worker nodes that the managed node group can scale out to.
public Nullable<double> MaxSize { get; set; }
Property Value
System.
Remarks
Managed node groups can support up to 100 nodes by default.
Default: - desiredSize
MaxUnavailable
The maximum number of nodes unavailable at once during a version update.
public Nullable<double> MaxUnavailable { get; set; }
Property Value
System.
Remarks
Nodes will be updated in parallel. The maximum number is 100.
This value or maxUnavailablePercentage
is required to have a value for custom update configurations to be applied.
Default: 1
MaxUnavailablePercentage
The maximum percentage of nodes unavailable during a version update.
public Nullable<double> MaxUnavailablePercentage { get; set; }
Property Value
System.
Remarks
This percentage of nodes will be updated in parallel, up to 100 nodes at once.
This value or maxUnavailable
is required to have a value for custom update configurations to be applied.
Default: undefined - node groups will update instances one at a time
MinSize
The minimum number of worker nodes that the managed node group can scale in to.
public Nullable<double> MinSize { get; set; }
Property Value
System.
Remarks
This number must be greater than or equal to zero.
Default: 1
NodegroupName
Name of the Nodegroup.
public string NodegroupName { get; set; }
Property Value
System.
Remarks
Default: - resource ID
NodeRole
The IAM role to associate with your node group.
public IRole NodeRole { get; set; }
Property Value
Remarks
The Amazon EKS worker node kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch worker nodes and register them into a cluster, you must create an IAM role for those worker nodes to use when they are launched.
Default: - None. Auto-generated if not specified.
ReleaseVersion
The AMI version of the Amazon EKS-optimized AMI to use with your node group (for example, 1.14.7-YYYYMMDD
).
public string ReleaseVersion { get; set; }
Property Value
System.
Remarks
Default: - The latest available AMI version for the node group's current Kubernetes version is used.
RemoteAccess
The remote access (SSH) configuration to use with your node group.
public INodegroupRemoteAccess RemoteAccess { get; set; }
Property Value
Remarks
Disabled by default, however, if you specify an Amazon EC2 SSH key but do not specify a source security group when you create a managed node group, then port 22 on the worker nodes is opened to the internet (0.0.0.0/0)
Default: - disabled
Subnets
The subnets to use for the Auto Scaling group that is created for your node group.
public ISubnetSelection Subnets { get; set; }
Property Value
Remarks
By specifying the
SubnetSelection, the selected subnets will automatically apply required tags i.e.
kubernetes.io/cluster/CLUSTER_NAME
with a value of shared
, where CLUSTER_NAME
is replaced with
the name of your cluster.
Default: - private subnets
Tags
The metadata to apply to the node group to assist with categorization and organization.
public IDictionary<string, string> Tags { get; set; }
Property Value
System.
Remarks
Each tag consists of a key and an optional value, both of which you define. Node group tags do not propagate to any other resources associated with the node group, such as the Amazon EC2 instances or subnets.
Default: - None
Taints
The Kubernetes taints to be applied to the nodes in the node group when they are created.
public ITaintSpec[] Taints { get; set; }
Property Value
Remarks
Default: - None