eksctl creates nodepools that are mostly immutable, except for autoscaling properties -
minimum and maximum number of nodes. In certain cases, it might be helpful to ‘scale up’
a nodegroup in a cluster before an event, to test cloud provider quotas or to make user
server startup faster.
Open the appropriate
.jsonnetfile for the cluster in question (located in theeksctlfolder). Depending on how you intend to scale the nodepools, there are two approaches you may take.Scale the desired nodepool
Depending on which nodepool(s) you want to scale up, tweak the arguments of cluster.withNodeGroupConfigOverride to match your needs.
cluster.withNodeGroupConfigOverride(
c,
kind='notebook',
instanceType='r5.4xlarge',
hubName='prod',
overrides={
desiredCapacity: 10,
minSize: 10,
}
)Where:
cis the cluster object created withcluster.makeClusterdefined ineksctl/libsonnet/cluster.jsonnetboth
minSizeanddesiredCapacityrepresent the number of nodes wanted in the nodepool
Render the
.jsonnetfile into a YAML file with:export CLUSTER_NAME=<your_cluster>jsonnet $CLUSTER_NAME.jsonnet > $CLUSTER_NAME.eksctl.yamlUse
eksctlto scale the cluster.eksctl scale nodegroup --config-file=$CLUSTER_NAME.eksctl.yamlValidate that appropriate new nodes are coming up by authenticating to the cluster, and running
kubectl get node.Commit the change and make a PR, and note that you have already completed the scaling operation. This is flexible, as the scaling operation might need to be timed differently in each case. The goal is to make sure that the
minSizeparameter in the github repository matches reality.