Last modified May 30, 2023
'gsctl create nodepool' command reference
gsctl and the REST API are being phased out. We recommend to familiarize yourself with our Management API and the kubectl gs plugin as a future-proof replacement. We provide a migration page to help you with the transition.
The gsctl create nodepool
command allows to create a new node pool in a cluster.
Usage
Execute the command giving the cluster ID as a positional argument. Further options can be given as command line flags.
Example:
$ gsctl create nodepool f01r4 \
--name "General purpose m4.2xlarge 3AZ autoscaling" \
--aws-instance-type m4.2xlarge \
--num-availability-zones 3 \
--nodes-min 3 \
--nodes-max 20
You can also use the cluster’s name for identifying the cluster:
$ gsctl create nodepool "Cluster name" \
--name "General purpose m4.2xlarge 3AZ autoscaling" \
--aws-instance-type m4.2xlarge \
--num-availability-zones 3 \
--nodes-min 3 \
--nodes-max 20
Spot instances
AWS
To request spot instances in your node pool on AWS, you have to set the percentage of worker nodes to be using spot instances via the --aws-spot-percentage
flag. Optionally you can also define a number of workers that will be guaranteed to use on-demand instances, using the flag --aws-on-demand-base-capacity
. Here is an example with 3 on-demand instances as a base capacity and 50 percent spot instances above that:
$ gsctl create nodepool "Cluster name" \
--name "General purpose m4.2xlarge 3AZ spot" \
--aws-instance-type m4.2xlarge \
--num-availability-zones 3 \
--aws-on-demand-base-capacity 3 \
--aws-spot-percentage 50
Azure
In order to use spot instances, specify the flag, like this:
$ gsctl create nodepool f01r4 \
--name "Production" \
--azure-spot-instances
Here is how you can set a maximum hourly price in USD that a single node pool VM instance can reach before it is deallocated:
$ gsctl create nodepool f01r4 \
--name "Production" \
--azure-spot-instances \
--azure-spot-instances-max-price 0.00315
By setting the --azure-spot-instances-max-price
flag to ‘-1’, the maximum price will be set to the on-demand price of the instance.
Options
-n, --name
: Name or purpose description of the node pool. Defaults to “Unnamed node pool”.--num-availability-zones
: Number of availability zones to use. Default is1
. Use this option if you don’t care about the specific zones to use.--availability-zones
: Comma-separated list of availability zones to use, instead of setting a number. Use this option if you care about the exact zones to use.--aws-instance-type
: EC2 instance type to use for workers, e. g.m5.2xlarge
.--aws-on-demand-base-capacity
: Number of on-demand instances that this node pool needs to have until spot instances are used. Defaults to0
.--aws-spot-percentage
: Percentage of spot instances used once the on-demand base capacity is fulfilled. A number of 40 would mean that 60% will be on-demand and 40% will be spot instances. Defaults to0
.--aws-use-alike-instance-types
: Use similar instance type in your node pool. This list is maintained by Giant Swarm at the moment. Eg if you select m5.xlarge then the node pool can fall back on m4.xlarge too.--azure-spot-instances
: Whether the node pool must use spot instances or on-demand.--azure-spot-instances-max-price
: Max bid hourly price (in USD) for a single instance.-1
means on-demand price.--azure-vm-size
: VM Size to use for workers, e.g.Standard_D4s_v3
.--nodes-min
: Minimum number of worker nodes for the node pool. Defaults to3
.--nodes-max
: Maximum number of worker nodes for the node pool. Defaults to10
.
Related
gsctl list nodepools
- List all node pools of a clustergsctl show nodepool
- Show details for a node poolgsctl update nodepool
- Modify a node poolgsctl delete nodepool
- Delete a node pool
Need help, got feedback?
We listen to your Slack support channel. You can also reach us at support@giantswarm.io. And of course, we welcome your pull requests!