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

brainy-beach-36627

05/04/2022, 10:12 AM
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

echoing-dinner-19531

05/04/2022, 10:36 AM
Does it work if you ignore just "scalingConfig"?
b

brainy-beach-36627

05/04/2022, 11:51 AM
Unfortunately no, same result with just
ignore_changes=["scalingConfig"]
e

echoing-dinner-19531

05/04/2022, 1:29 PM
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

worried-xylophone-86184

08/11/2022, 9:29 AM
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

echoing-dinner-19531

08/11/2022, 9:36 AM
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

worried-xylophone-86184

08/11/2022, 9:37 AM
Right.
b

brainy-beach-36627

08/11/2022, 9:50 AM
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

worried-xylophone-86184

08/11/2022, 9:51 AM
Hey Joffrey ! I tried transformations. Got the same warning. I still have to break it to my team. 😅
e

echoing-dinner-19531

08/11/2022, 9:52 AM
Why did the transformation not work?
w

worried-xylophone-86184

08/11/2022, 9:55 AM
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

echoing-dinner-19531

08/11/2022, 9:56 AM
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

brainy-beach-36627

08/11/2022, 9:57 AM
Transformations work only if you use the same language than the component, right ?
e

echoing-dinner-19531

08/11/2022, 9:58 AM
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 😞
30 Views