When creating a `new eks.Cluster` how can I add sc...
# general
e
When creating a
new eks.Cluster
how can I add scaling policies, e.g. "scale up when average CPU utilization is > 70%" ?
w
In principle you can do something like:
Copy code
const scalingPolicy = new aws.autoscaling.Policy("scaleup", {
    targetTrackingConfiguration: {
        predefinedMetricSpecification: {
            predefinedMetricType: "ASGAverageCPUUtilization",
        },
        targetValue: 75,
    },
    autoscalingGroupName: asgName,
});
However, it looks like we don't currently make it easy to get the
asgName
that is used by the NodeGroup(s) that
new eks.Cluster
and
new eks.NodeGroup
create. I'll open an issue to track exposing that name so this is easier to stitch together. You'll also want to make sure you specify appropriate
minSize
and
maxSize
on the NodeGroup/Cluster.
e
thanks