cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

Allow multiple security group filter matches

Open dlmather opened this issue 3 years ago • 16 comments
trafficstars

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:

  • [X] squashed commits
  • [ ] includes documentation
  • [X] adds unit tests
  • [ ] adds or updates e2e tests

dlmather avatar Jun 13 '22 23:06 dlmather

@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 avatar Jun 13 '22 23:06 k8s-ci-robot

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 avatar Jun 13 '22 23:06 k8s-ci-robot

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: https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues/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?

sedefsavas avatar Jun 13 '22 23:06 sedefsavas

/ok-to-test

richardcase avatar Jun 17 '22 07:06 richardcase

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 avatar Jun 17 '22 21:06 dlmather

/retest

dlmather avatar Jun 17 '22 21:06 dlmather

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

Ankitasw avatar Jun 23 '22 09:06 Ankitasw

/lgtm

Ankitasw avatar Jun 27 '22 08:06 Ankitasw

cc @richardcase @sedefsavas for review/approval.

Ankitasw avatar Jul 01 '22 14:07 Ankitasw

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

Ankitasw avatar Jul 14 '22 13:07 Ankitasw

@dlmather could you please rebase the changes.

Ankitasw avatar Aug 11 '22 10:08 Ankitasw

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

sedefsavas avatar Aug 11 '22 10:08 sedefsavas

/milestone v1.6.0

richardcase avatar Sep 02 '22 10:09 richardcase

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

Ankitasw avatar Oct 04 '22 13:10 Ankitasw

New changes are detected. LGTM label has been removed.

k8s-ci-robot avatar Oct 13 '22 17:10 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign sedefsavas for approval by writing /assign @sedefsavas in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Oct 13 '22 17:10 k8s-ci-robot

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

Ankitasw avatar Oct 20 '22 08:10 Ankitasw

/milestone v2.0.0

Ankitasw avatar Oct 25 '22 14:10 Ankitasw

@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.

k8s-ci-robot avatar Oct 25 '22 14:10 k8s-ci-robot

/milestone v2.0.0

richardcase avatar Oct 25 '22 14:10 richardcase

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

Ankitasw avatar Oct 26 '22 05:10 Ankitasw

@Ankitasw all squashed now, thanks!

dlmather avatar Oct 27 '22 17:10 dlmather

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

Ankitasw avatar Oct 27 '22 17:10 Ankitasw

/lgtm /approve /hold until test passes

Ankitasw avatar Oct 27 '22 17:10 Ankitasw

[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 avatar Oct 27 '22 17:10 k8s-ci-robot

/unhold

Ankitasw avatar Oct 28 '22 04:10 Ankitasw