Fix autoscaling policy to correctly handle eks:DescribeNodegroup permission #292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
##Summary
This PR fixes the IAM policy for the Cluster Autoscaler to correctly handle the
eks:DescribeNodegroup
permission.##Rationale
The Cluster Autoscaler encounters the following error, indicating an AccessDeniedException for "eks:DescribeNodegroup":
E0604 20:35:15.324713 1 aws_manager.go:308] Failed to get labels from EKS DescribeNodegroup API for nodegroup cas-202401... in cluster viya-... because AccessDeniedException: User: arn:aws:sts::7...
/viya-...-cluster-autoscaler/17... is not authorized to perform eks:DescribeNodegroup on resource: arn:aws:eks:ca-central-1:7...:nodegroup/viya.../cas-202401...-dea0-52....
The condition in the existing policy applies to Auto Scaling Groups, but eks:DescribeNodegroup operates on EKS-managed node groups. IAM permissions might be checking for these tags on the node group resource, not just the underlying ASG. As a result, tags on ASGs might not propagate or apply in the way it is expected.