SPLAT-2452: Add SetSecurityGroups IAM permission to master nodes for BYO SG support for AWS NLBs#10512
Conversation
Adds the elasticloadbalancing:SetSecurityGroups IAM permission to master nodes, which is required for the BYO Security Groups feature for AWS Network Load Balancers on AWS CCM.
|
@mfbonfigli: This pull request references SPLAT-2452 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set. DetailsIn 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. |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughUpdated the inline IAM policy for the AWS cluster API master role to add the ELB permission Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Thanks for submitting PR, I think it makes sense as CCM uses CP instance profile.
PTAL to the detected policies by SREP-3643 and if it would be required too here, looks like some are not included to the master profile as well.
Also for follow up:
- We need to make sure OCP docs is updated with new set of permissions (follow up card from your Epic)
- review/update the UPI assets:
- I think we need to review the CAPA IAM too:
installer/pkg/infrastructure/aws/clusterapi/iam.go
Lines 98 to 99 in 0bd82bc
Adds the elasticloadbalancing:SetSecurityGroups permissions to the UPI cloudformation template, required for the AWS CCM BYO Security Group feature for AWS Network Load Balancers.
Thanks @mtulio , I updated the PR to include the UPI template. Will work on updating the openshift documentation as a separate task. |
mtulio
left a comment
There was a problem hiding this comment.
Thanks for addressing the comments.
/lgtm
@mfbonfigli can we trigger e2e-aws workflow with /testwith PRs on downstream?
/hold
Hey Patrick and Thuan, would you mind taking a look? Thanks
FWIW as mentioned in the PR description, this change is required by CCM, which currently is still using the IAM Role/Profile's policy of Control Plane, as this is a core component, and feature is enabled by default when shipped, we can't evaluate conditionals on install-config to group it.
/assign @tthvo @patrickdillon
|
/retest |
|
/test e2e-aws-ovn-heterogeneous |
|
@mfbonfigli: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
tthvo
left a comment
There was a problem hiding this comment.
/approve
Since the feature is enabled in Default clusters, this change looks good to me 👍 I also cross-referenced with permissions required by CAPA to call ApplySecurityGroupsToLoadBalancer 👇
As Marco said, we definitely should ensure openshift docs reflect this new permission, especially if the users bring their own IAM roles/profiles to control plane machine pool.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tthvo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@mfbonfigli @mtulio maybe you guys can add the |
|
/testwith openshift/installer/main/e2e-aws-ovn openshift/cloud-provider-aws#152 openshift/cluster-cloud-controller-manager-operator#460 |
Context
As part of the new Bring Your Own Security Groups (BYO SG) for AWS Network Load Balancers (NLBs) feature currently under review in upstream, it is required to add a new
elasticloadbalancing:SetSecurityGroupspermission to the role used by AWS CCM to interact with AWS APIs.The
elasticloadbalancing:SetSecurityGroupspermission is required to enable AWS CCM to change the security groups associated with Network Load Balancers without deleting and recreating the NLB, which is not viable.Without this permission, the following operations are not possible:
The new permission is similar to
elasticloadbalancing:ApplySecurityGroupsToLoadBalancerwhich is already present and required to edit BYO Security Groups associated with Classic Load Balancers (CLBs).The upstream
kOpsKubernetes infrastructure provisioning tool has been already updated to add the required permission: kubernetes/kops#18211References:
kOpsto add to the Kubernetes cluster install tool support for the new permission (already merged): Support NLBSecurityGroupMode for AWS Cloud Controller Manager kubernetes/kops#18211Summary by CodeRabbit