https://pulumi.com logo
#aws
Title
# aws
b

bumpy-laptop-30846

02/22/2022, 10:19 AM
Hello, I have an issue with eks autoscaling. I create the cluster with default auto scaling like so:
Copy code
return new eks.Cluster(
  getClusterName(),
  {
    name: getClusterName(),
    vpcId: vpc.id,
    publicSubnetIds: vpc.publicSubnetIds,
    privateSubnetIds: vpc.privateSubnetIds,
    nodeAssociatePublicIpAddress: false,
    instanceType: 'c5.xlarge',
    nodeRootVolumeSize: 50,
    desiredCapacity: 3,
    minSize: 2,
    maxSize: 8,
but when I add a deployment it does not increase the number of nodes. Is there something to do to have autoscaling working when using the cluster default nodegroup?
q

quiet-wolf-18467

02/22/2022, 11:29 AM
It's unlikely that a single Deployment is going to cause the autoscaler to kick-in. The default auto scaler monitors for pods that fail to schedule and will react by adding new nodes.
You can test this by adding resource requests to your deployment that are large and scale the deployment to 12, 20, or 50 replicas and it should encourage autoscaling
b

bored-table-20691

02/22/2022, 11:56 AM
Typically you would need to deploy something like cluster-autoscaler as well, no? I don't believe that EKS installs it for you, just that the node groups have the right labels automatically
b

bumpy-laptop-30846

02/22/2022, 12:52 PM
@quiet-wolf-18467 yes I already had an existing deployment. I have a pod which is in
pending
state and cluster indicates ‘insufficient cpu’
there is an autoscaling group created by pulumi when I create the cluster. But it does not kick in when needed.
I do nothing special, no idea about what is wrong.
c

curved-pencil-86122

02/22/2022, 1:03 PM
As Itay mentioned you need to install also cluster-autoscaler.
b

bumpy-laptop-30846

02/22/2022, 1:26 PM
ok thanks, is it mentioned somewhere in the pulumi docs?
I mean if it’s not the case, it’s a big missing block
b

bored-table-20691

02/22/2022, 1:56 PM
This is more a function of Kubernetes and how you would do autoscaling than it is with Pulumi. You’d have the same issue if you provisioned an EKS cluster with Terraform or CloudFormation.
b

bumpy-laptop-30846

02/22/2022, 2:01 PM
yes but what is the point of indicating minSize, maxSize, and desiredCapacity if there is not autoscaling ?
b

bored-table-20691

02/22/2022, 2:22 PM
These are the arguments to the AWS auto-scaling groups (the thing that back EKS’ node groups). But there needs to be a signal to the autoscaling group, which in this would come from cluster-autoscaler (or something like Karpenter if you wanted something else).
👍 1
b

bumpy-laptop-30846

02/22/2022, 4:29 PM
I found this. Too bad there is not the same thing in ts 🙂 https://github.com/jaxxstorm/pulumi-clusterautoscalerx/blob/master/main.go
but it gives a pretty good idea
3 Views