b

    bumpy-laptop-30846

    7 months ago
    Hello, I have an issue with eks autoscaling. I create the cluster with default auto scaling like so:
    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

    7 months ago
    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

    7 months ago
    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

    7 months ago
    @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

    7 months ago
    As Itay mentioned you need to install also cluster-autoscaler.
    b

    bumpy-laptop-30846

    7 months ago
    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

    7 months ago
    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

    7 months ago
    yes but what is the point of indicating minSize, maxSize, and desiredCapacity if there is not autoscaling ?
    b

    bored-table-20691

    7 months ago
    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).
    b

    bumpy-laptop-30846

    7 months ago
    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