-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCPBUGS-45218: aws: fix perm requirement for edge nodes #9256
OCPBUGS-45218: aws: fix perm requirement for edge nodes #9256
Conversation
@r4f4: This pull request references Jira Issue OCPBUGS-45218, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/uncc @andfasano |
/jira refresh |
@r4f4: This pull request references Jira Issue OCPBUGS-45218, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
I think requiring this perm is a good idea /approve IIRC the permission check is a dependency of the cluster asset and runs after the machine manifests have been generated. I am on my phone right now and can’t double check, but if that is the case it seems like the following could happen:
If i am mistaken and permissions checks run earlier then this wouldn’t be possible. Also i dont think we need to hold up this pr with solving this problem but just wanted to point out this potential edge case for discussion |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This LGTM but let’s get another reviewer to take a look |
Indeed that's a problem. The
compared to the
Isn't that an existing installer bug? Generating worker manifests involves SDK calls not only for AWS but also for other platforms. I'll open a separate bug to handle that. |
I created https://issues.redhat.com/browse/OCPBUGS-45657 to address the point raised by Patrick. |
logrus.Warnf("failed to find preferred instance type for one or more zones in the %s pool, using default: %s", pool.Name, instanceTypes[0]) | ||
mpool.InstanceType = instanceTypes[0] | ||
if !awsSetPreferredInstanceByEdgeZone(ctx, instanceTypes, installConfig.AWS, zones) { | ||
// Using the default instance type from the non-edge pool often fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the main part related to the bug. Is it ok to fail here (i.e. is this the intended behavior)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My proposal is: it seems better to fail here instead of having an undetected node failing to come up with the error as in the PR's description. The non-edge node default might not be compatible with edge zones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM failing when any zone isn't found the respective type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@mtulio can you review this one? |
PermissionEdgeDefaultInstance: { | ||
// Needed to filter zones by instance type | ||
"ec2:DescribeInstanceTypeOfferings", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@r4f4 @patrickdillon I would like to exercise a little bit more this comment. Isn't ec2:DescribeInstanceTypeOfferings
called every installer execution to discover types from the pool, and fallback to static ones regardless of the pool type? My impression that this permissions must be in the base set of required permissions, instead of only when edge zones is added.
Holding until hear from you all. Feel free to drop.
/hold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not every execution, only when the instanceType is not set and/or when zones are not specified. For the former, we fallback to a hardcoded type so the permission is optional. The problem with that logic for edge zones is that not all regions and instance types support them.
If you want to make it required for all cases, that should be addressed as a separate bug as it impacts managed services and their managed policies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not every execution, only when the instanceType is not set and/or when zones are not specified
Yeah, apologies. I mean default execution flow which those fields isn't set/required - and I am not sure if we have a CI scenario of that flow as a couple of fields were enforced in CI to, specially, save costs, preventing spreading the cluster across all zones discovered in the region.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as it impacts managed services and their managed policies.
If this change is only to support managed services flow for now, LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree @mtulio that ec2:DescribeInstanceTypeOfferings
should be required in the default permission set for all installs.
If you want to make it required for all cases, that should be addressed as a separate bug as it impacts managed services and their managed policies.
@r4f4 should we open a new bug? I believe rosa supports edge zones (@mtulio probably knows better than I do) so I would think as it stands, this would affect the rosa policy as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. So it looks like there are at least two regions that don't have M6i: eu-south-2
& ap-southeast-4
. So IIUC the issue is that IFF you're installing to one of those regions & don't have this perm & don't specify an instance type, the install would fail (as it will default to the unavailable m6i instance).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Patrick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mtulio are you happy to proceede with this PR and make the perm always required as part of the new bug Patrick opened?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So IIUC the issue is that IFF you're installing to one of those regions & don't have this perm & don't specify an instance type, the install would fail (as it will default to the unavailable m6i instance).
Correct.
@r4f4 Yes. Patrick described the rationale behind my thoughts. When we introduced m6i
we aimed better performance for the same price for control planes (in general new instances increases ~15%, and are cheaper, except 7th Gen). That time, m6i was available in a few regions, but the algorithm covered that edge cases.
@mtulio are you happy to proceede with this PR and make the perm always required as part of the new bug Patrick opened?
Yes.
/lgtm
FWIW some time ago I wrote an ugly script to collect and consolidate that information across zones around the globe, and mount the supported instance types on edge zones and in the region, if you are interested to explore, this could be a start point, and sample output.
55d4f83
to
30724f9
Compare
Update: rebased on top of master to fix merge conflicts. |
/retest-required |
/retest-required |
/hold cancel |
/label acknowledge-critical-fixes-only |
/override ci/prow/e2e-azure-ovn-upi |
@r4f4: Overrode contexts on behalf of r4f4: ci/prow/e2e-azure-ovn-upi In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest-required |
@r4f4: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/override ci/prow/e2e-azure-ovn-upi |
@r4f4: Overrode contexts on behalf of r4f4: ci/prow/e2e-azure-ovn-upi In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
f7a8032
into
openshift:main
@r4f4: Jira Issue OCPBUGS-45218: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-45218 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
[ART PR BUILD NOTIFIER] Distgit: ose-installer-altinfra |
[ART PR BUILD NOTIFIER] Distgit: ose-installer-terraform-providers |
[ART PR BUILD NOTIFIER] Distgit: ose-baremetal-installer |
/cherry-pick release-4.18 |
@r4f4: new pull request created: #9334 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[ART PR BUILD NOTIFIER] Distgit: ose-installer-artifacts |
If an edge machine pool is specified without an instance type, the installer needs the
ec2:DescribeInstanceTypeOfferings
permission to derive the correct instance type available according to the local/wavelength zones being used.Before this change, the permission was optional and its absence would result in the installer picking a hard-coded non-edge pool instance type which can cause unsupported configuration issues in mapi's output: