-
Bug
-
Resolution: Unresolved
-
Major
-
4.21
Description of problem:
Scale from zero does not work properly for ROSA HCP clusters because the nodepool IAM policies are missing the ec2:DescribeInstanceTypes permission. For scale from zero to work correctly, the AWSMachineTemplate.Status.Capacity fields need to be populated with information from EC2 instances. Without the permission, this information cannot be retrieved. Previously, capacities were set by the hypershift operator (which already has this permission) as annotations. With the latest changes in CAPA, the AWSMachineTemplate.Status.Capacity field is reconciled by the provider instead, and therefore, it needs the same permission to gather the data from the EC2 instances.
How reproducible:
Always
Steps to Reproduce:
1. Create a ROSA HCP cluster with a nodepool configured for scale-to-zero. 2. Scale the nodepool down to zero replicas. 3. Trigger a scale-up event (e.g., deploy a workload that requires the nodepool). 4. Observe that scale from zero fails or capacity information is not available.
Actual results:
Error when trying to set the capacity: Failed to query capacity for instance type \"m5.large\": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 4bf99097-c143-4f7d-806f-ea4712159e7a, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::820196288204:assumed-role/node-pool-xfbfv-node-pool/1770220345520145531 is not authorized to perform: ec2:DescribeInstanceTypes
Expected results:
Capacity properties can be set without permission errors when describing EC2 instances.