AWS Node Groups
Node Groups
A Node Group in PMK is an entity that represents a group of nodes. Node Groups provide you a way to group and segregate your worker nodes for different purposes. PMK support two types of Node Groups:
- Machine Deployment
- Machine Pool
Node Group Benefits
- Node Groups automate the provisioning and lifecycle management of nodes in AWS CAPI Kubernetes clusters.
- You can add multiple Node Groups of any type to the Cluster while creating it or to an existing cluster as well.
- You can scale up, scale down, delete, update, and enable/disable auto-scaling for a Node Group individually.
- Node updates and terminations automatically drain nodes to ensure that your applications stay available.
AWS Node Group Feature Matrix
You can decide the type of Node Group to use, based on the following.
Feature | Machine Deployment | AWS Machine Pool |
---|---|---|
CRUD Operations | ✅ | ✅ |
CAPI Cluster Auto-Scaler Support | ✅ | |
Availability Zone Selection | ✅ | |
Mixed Instances Support | ✅ | |
Spot Instance Support | ✅ | ✅ |
Bulk Labels and Taints | ✅ | ✅ |
Nodes Rolling Updates | ✅ | ✅ |
Node Groups Configuration Options
Machine Deployment
Field | Description |
---|---|
Name | User-defined name for the Machine Deployment. The default name is recommended and always present for this. |
Node Count | Provide the number of nodes to be created and associated with the node group. |
Instance Type | Choose the type of EC2 instance to be used for nodes belonging to the node group. |
Operating System | Choose the Operating system to be nodes belonging to the node group.
|
Custom AMI ID | Enter an AMI ID of your choice. Note: Only Cluster API conformant AMIs can be used to create CAPI clusters. Read https://image-builder.sigs.k8s.io/capi/providers/aws.html to create your own custom AMIs. When using custom AMIs, the secret manager is set to false. |
Make Nodes Public | Enabling this will put the nodes belonging to the node group in public subnets of the VPC and assign an elastic IP for the nodes so that the nodes are publicly accessible and users can ssh into them. |
Enable Autoscaling | Enable this option will annotate the Node Group for the Cluster-AutoScaler to manage the auto-scaling of this node group. Following annotations are added on the Machine Deployment Type Node Group resource:
|
Min Number of Workers | Choose the minimum number of nodes the node group can have. |
Max Number of Workers | Choose the maximum number of nodes the node group can have. |
Enable Spot Instances | Enables Spot Instances to be used for the nodes of the node group. Read more here: https://aws.amazon.com/ec2/spot/. |
Spot Instance Maximum Price | Enter the price for the spot instance. Empty means max price which is recommended to ensure that the spot instance is assigned. Read more here on spot instance pricing: https://aws.amazon.com/ec2/spot/pricing/. |
Strategy | The deployment strategy to use to replace existing machines(nodes). MachineDeployment type Node Groups only support Rolling Update type. |
Max Surge - Type | Choose the type for the maximum number of machines that can be scheduled above the desired number of machines. Number and Percentage are supported options. |
Max Surge - Value | Choose the maximum number of machines that can be scheduled above the desired number of machines.
|
Max Unavailable - Type | Choose the type for the maximum number of machines that can be unavailable during the node updates. Number and Percentage are supported options. |
Max Unavailable - value | Choose the maximum number of machines that can be unavailable during the node update.
|
Labels | Add labels to the node Groups. Labels added will be applied on creation to each node belonging to this node group. |
Taints | Add taints to the node Groups. Taints added will be applied on creation to each node belonging to this node group. |
Machine Pool
Field | Description |
---|---|
Name | User-defined name for the Machine Pool. The default name is recommended and always present for this. |
Availability Zone | Choose the AvailabilityZones in which the Node Instances can run in. Machine Pools have a dedicated AWS Auto Scaling Group which determines the placement of the nodes on the basis of the AZ selection. |
Node Count | Provide the number of nodes to be created and associated with the node group. |
Instance Type | Choose the type of EC2 instance to be used for nodes belonging to the node group. |
Operating System | Choose the Operating system to be nodes belonging to the node group.
|
Custom AMI ID | Enter an AMI ID of your choice. Note: Only Cluster API conformant AMIs can be used to create CAPI clusters. Read https://image-builder.sigs.k8s.io/capi/providers/aws.html to create your own custom AMIs. When using custom AMIs, the secret manager is set to false. |
Make Nodes Public | Enabling this will put the nodes belonging to the node group in public subnets of the VPC and assign an elastic IP for the nodes so that the nodes are publicly accessible and users can ssh into them. |
Min Number of Workers | Choose the minimum number of nodes the node group can have. |
Max Number of Workers | Choose the maximum number of nodes the node group can have. |
Enable Mixed Instances | Enables Enable Mixed Instances to create a policy that describes how multiple instances( On-Demand vs Spot ) types will be used by the ASG. If not set all nodes of this node group will be of On-Demand type. Read more here: |
Nodes On Demand Base Capacity | Choose the minimum number of nodes that will be of On-Demand type. Defaults to 0, which means none of the nodes will be On-Demand type and all spot instances will be created for this node group. |
Nodes on Demand % Above Base | Choose the number of nodes that will be of On-Demand type above the base capacity. Defaults to 100, which means all the nodes above base capacity will be Demand type.
|
Spot Instance Allocation Strategy | Choose the Spot Allocation Strategy between lowest-price and capacity-optimized.
|
Strategy | The strategy to use to replace existing machines(nodes). Machine Pool type Node Groups only support Rolling Update type. The only valid value is Rolling. A rolling update is an update that is applied to all instances in an Auto Scaling group until all instances have been updated. |
Minimum Healthy Nodes - Type | Choose the type for setting the amount of capacity in ASG that must remain healthy during an instance refresh. The only supported type is Percentage. |
Minimum Healthy Nodes Percentage- Value | Choose the amount of capacity as a percentage in ASG that must remain healthy during an instance refresh. The default is 90.
|
Labels | Add labels to the node Groups. Labels added will be applied on creation to each node belonging to this node group. |
Taints | Add taints to the node Groups. Taints added will be applied on creation to each node belonging to this node group. |