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

When tagging security groups, ensure cloud provider tag is only on lb #4571

Merged

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented Oct 11, 2023

What type of PR is this?

What this PR does / why we need it:

/kind cleanup

This is an improvement on the current logic that blindly sets tags on security groups. The cloud provider expects only a single load balancer to be tagged with kubernetes.io/cluster/test = owned. By default, we already tag the lb security group, we should ensure all the other security groups remain untagged.

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

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Oct 11, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 11, 2023
@JoelSpeed
Copy link

I think this is helpful for preventing users from shooting themselves in the foot, though, how will users know that the security groups don't get those tags, should we log a line at least?
If they requested the additional tag, we should probably make sure to make it at least somewhat visible that we are denying their request

@vincepri vincepri force-pushed the security-group-tag-owned branch from 207657b to 4c59deb Compare October 11, 2023 15:49
@vincepri
Copy link
Member Author

@JoelSpeed Good idea, added a debug log

@vincepri vincepri force-pushed the security-group-tag-owned branch from 4c59deb to fbcf962 Compare October 11, 2023 15:58
@vincepri vincepri changed the title When tagging security groups, ensure cloud provide tag is only on lb When tagging security groups, ensure cloud provider tag is only on lb Oct 11, 2023
@JoelSpeed
Copy link

/lgtm

Thanks for adding that log line, this is a good addition to stop people from creating broken clusters

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 11, 2023
@vincepri
Copy link
Member Author

/test ?

@k8s-ci-robot
Copy link
Contributor

@vincepri: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-clusterclass
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks
  • /test pull-cluster-api-provider-aws-e2e-eks-gc
  • /test pull-cluster-api-provider-aws-e2e-eks-testing

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

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.

@vincepri
Copy link
Member Author

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

@vincepri
Copy link
Member Author

/retest

@vincepri
Copy link
Member Author

not related

/retest

@vincepri
Copy link
Member Author

/retest

@vincepri
Copy link
Member Author

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit 994c30f into kubernetes-sigs:main Oct 13, 2023
r4f4 added a commit to r4f4/installer that referenced this pull request Mar 19, 2024
Because of how the CCM selects a Load Balancer security group by using the
"kubernetes.io/cluster/<infraID>: owned" tag, CAPA removes that tag from
all the other security groups [1].

That means that when the Installer is looking for resources to delete
with that tag, it will never find those security groups and they'll stay
behind. To avoid that, let's also search for resources with the
"sigs.k8s.io/cluster-api-provider-aws/cluster/<infraID>: owned" tag
during cluster destroy.

[1] kubernetes-sigs/cluster-api-provider-aws#4571
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note-none Denotes a PR that doesn't merit a release note. 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.

3 participants