Hi ! I use pulumi eks to manage our EKS clusters. ...
# general
b
Hi ! I use pulumi eks to manage our EKS clusters. We add
ignore_changes=["scalingConfig.desiredSize"]
inside eks.ManagedNodeGroup() to let the autoscaler manage this value, but it doesn’t seems to work. When I run pulumi preview --diff, the config si not ignored :
Copy code
~ scalingConfig: {
              ~ desiredSize: 4 => 1
            }
Does someone had a similar issue ?
e
Does it work if you ignore just "scalingConfig"?
b
Unfortunately no, same result with just
ignore_changes=["scalingConfig"]
e
Odd, can your raise an issue on the eks repo about this? Might be an engine bug, might be how eks is written issue.
👍 2
w
Facing a similar issue with Managed Nodegroups on trying to ignore scalingConfig
I believe this has already been acknowledged that its not supported https://github.com/pulumi/pulumi/issues/9704 https://github.com/pulumi/pulumi-eks/issues/709
e
Ah 🤦‍♂️ yes of course that exactly the issue I thought the engine would print a warning about this now? Something like "The option 'ignore_changes' has no effect on component resources."
w
Right.
b
Do you know if we can get around this issue ? So far I didn’t find anything and we have to change the desiredSize each time :(
w
Hey Joffrey ! I tried transformations. Got the same warning. I still have to break it to my team. 😅
e
Why did the transformation not work?
w
This is my code:
Copy code
def ignore_scaling_config(self, args: ResourceTransformationArgs):
        print(args.props)
        print(args.opts)
        if args.type_ == "eks:index:ManagedNodeGroup":
            return ResourceTransformationResult(
                props=args.props,
                opts=ResourceOptions.merge(args.opts, ResourceOptions(
                    ignore_changes=["scalingConfig"],
            )))
Copy code
eks_node_group = ManagedNodeGroup(
            node_group["name"],
            node_group_name=node_group["name"],
            subnet_ids=nodegroup_azs,
            cluster=self.eks_cluster.core,
            capacity_type=capacity_type,
            taints=taints,
            labels=node_group.get("labels", None),
            instance_types=node_group["instance_types"],
            node_role_arn=self.eks_ec2_role.arn,
            scaling_config=nodegroup_scaling_args,
            launch_template=launch_template_args,
            tags=tag_args,
            opts=ResourceOptions(
                transformations=[self.ignore_scaling_config]
            ),
        )
I just closed my terminal but when I got the warning I figured internally it was trying to do the same thing as
ResourceOptions.ignore_changes
e
oh right, trying to set ignore_changes in the transform, yeh that's gonna hit the same limitation sadly 😞
I thought you were trying to re-set the scalingConfig value itself, and that should work
b
Transformations work only if you use the same language than the component, right ?
e
hmm actually thinking about it, I think they'd only work if you weren't using the same language
in-language vs out-language components are very different
actually thinking more, I think they would work for out-of-language components but not the custom resources those components make, and wouldn't work for in-language components but would work for the custom resources those components make. Which is pretty inconsistent and awkward 😞