Skip to content
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

Allow multiple security group filter matches #3526

Conversation

dlmather
Copy link
Contributor

@dlmather dlmather commented Jun 13, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:

Current behavior for additional security groups especially when using filters is somewhat cumbersome and mysterious. If a filter has no potential matches, it will silently blackhole all additional security groups due to returning up an error which is eventually silently dropped. Additionally, a choice was made to only return the first match from a specified filter. It would be nice to be able to instead match all security groups returned by a filter so that tags can be used to implicitly add security groups to AWSMachines in a more dynamic way. Finally, in the current setup, it is considered an error to have a filter match that returns no results... this forces the requirement that all security groups must be created before the creation of an AWSMachineTemplate using them. This creates a back-and-forth in Cluster bootstrap, since we need the VPC to exist before defining security groups, but then must circle back to retroactively add security group matchers, which in turn requires rolling all MachineDeployments that wish to use the SecurityGroups.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 13, 2022
@k8s-ci-robot
Copy link
Contributor

@dlmather: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

Hi @dlmather. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 13, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 13, 2022
@sedefsavas
Copy link
Contributor

Failing to reconcile when additional SGs could not be found is a change of behaviour, so we can do this change in the v1beta2 version. It'd be good to track this here: #2355

Since we already support list of additional SGs in other places, makes sense to add multiple additional SGs support to launchtemplates, could you file an issue and modify this PR to only cover that?

@richardcase
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 17, 2022
@dlmather dlmather force-pushed the support-multiple-additional-security-groups branch from b31fc43 to c916db3 Compare June 17, 2022 21:46
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 17, 2022
@dlmather
Copy link
Contributor Author

dlmather commented Jun 17, 2022

Failing to reconcile when additional SGs could not be found is a change of behaviour

Just to clarify, we would no longer fail to reconcile when SGs couldn't be found under this change. As you say though, this is definitely a change of behavior from the current setup where failing to find SGs in any listed filter drops all AdditionalSecurityGroups.

@dlmather
Copy link
Contributor Author

/retest

@richardcase richardcase mentioned this pull request Jun 21, 2022
4 tasks
@Ankitasw
Copy link
Member

/test pull-cluster-api-provider-aws-e2e

@Ankitasw
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 27, 2022
@Ankitasw
Copy link
Member

Ankitasw commented Jul 1, 2022

cc @richardcase @sedefsavas for review/approval.

@Ankitasw
Copy link
Member

I think this PR is good to go.
@sedefsavas could you PTAL?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 4, 2022
@Ankitasw
Copy link
Member

@dlmather could you please rebase the changes.

@sedefsavas
Copy link
Contributor

Based on this comment above, let's wait until we open the main branch to v1beta2 changes before rebasing to avoid double efforts.

@richardcase
Copy link
Member

/milestone v1.6.0

@k8s-ci-robot k8s-ci-robot added this to the v1.6.0 milestone Sep 2, 2022
@Ankitasw
Copy link
Member

Ankitasw commented Oct 4, 2022

@dlmather could you rebase your PR, as the main branch is now open for the API changes.

@dlmather dlmather force-pushed the support-multiple-additional-security-groups branch from c916db3 to 688de9f Compare October 13, 2022 17:52
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 13, 2022
@Ankitasw
Copy link
Member

@dlmather This looks good. please squash your commits so that I can merge.

@Ankitasw
Copy link
Member

/milestone v2.0.0

@k8s-ci-robot
Copy link
Contributor

@Ankitasw: You must be a member of the kubernetes-sigs/cluster-api-provider-aws-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Cluster API Provider AWS Maintainers and have them propose you as an additional delegate for this responsibility.

In response to this:

/milestone v2.0.0

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/test-infra repository.

@richardcase
Copy link
Member

/milestone v2.0.0

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.6.0, v2.0.0 Oct 25, 2022
@Ankitasw
Copy link
Member

@dlmather could you squash your commits so that we can merge this?

@dlmather dlmather force-pushed the support-multiple-additional-security-groups branch from a1a3bc4 to d05f2c1 Compare October 27, 2022 17:03
@dlmather
Copy link
Contributor Author

@Ankitasw all squashed now, thanks!

@Ankitasw
Copy link
Member

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

@Ankitasw
Copy link
Member

/lgtm
/approve
/hold
until test passes

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 27, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ankitasw

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2022
@Ankitasw
Copy link
Member

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit a879df7 into kubernetes-sigs:main Oct 28, 2022
@k8s-ci-robot k8s-ci-robot modified the milestones: v2.0.0, v1.x Oct 28, 2022
@dlmather dlmather deleted the support-multiple-additional-security-groups branch October 28, 2022 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants