pulumi-eks
pulumi-eks copied to clipboard
Allow ignoring changes to `desiredSize` of Node Groups for Cluster Autoscaler support
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
When using Cluster Autoscaler for automatically scaling node groups based on cluster requirements pulumi permanently shows a diff.
The problem is because the cluster autoscaler takes control of the desiredSize of the scalingConfig, putting it out of sync with Pulumi state.
In pulumi, the recommended way to handle a case like this is to have Pulumi give up control over the specified property with the ignoreChanges option.
However, currently in Pulumi, ignoreChanges does nothing when given to a ComponentResource. See docs.
My suggestion for a simple and easy fix would be to pass ignoreChanges passed to the resource down to the options of the internally created aws.eks.NodeGroup or ASG when using the NodeGroup/NodeGroupV2 component.
Hey @JustASquid,
this sounds like a good enhancement to the node groups! I can see us adding a new parameter (e.g. ignoreDesiredSize) to the scalingConfig.
In the meantime you can achieve this using transforms as a workaround. For example using typescript:
const mng = new eks.ManagedNodeGroup("example-ng", {
cluster: cluster,
nodeGroupName: "aws-managed-ng",
nodeRoleArn: role.arn,
scalingConfig: {
desiredSize: 4,
maxSize: 10,
minSize: 1,
}
}, { transforms: [args => {
if (args.type === "aws:eks/nodeGroup:NodeGroup") {
return {
props: args.props,
opts: pulumi.mergeOptions(args.opts, { ignoreChanges: ["scalingConfig.desiredSize"] })
}
}
return undefined;
}]});
@JustASquid I slightly changed the title and description to capture more details. Let me know if I missed something!
With https://github.com/pulumi/pulumi/issues/12154 feature we could one day direct the user to transforms or emit warnings on unused ignoreChanges accordingly.
This is done now and will be released as part of EKS v3