https://pulumi.com logo
#general
Title
# general
e

early-musician-41645

01/25/2019, 12:45 AM
When creating a
new eks.Cluster
how can I add scaling policies, e.g. "scale up when average CPU utilization is > 70%" ?
w

white-balloon-205

01/25/2019, 7:59 PM
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

early-musician-41645

01/28/2019, 7:40 PM
thanks
3 Views