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

OpenStack: Remove SGS created by CPO on destroy #7378

Merged
merged 1 commit into from Aug 2, 2023

Conversation

dulek
Copy link
Contributor

@dulek dulek commented Jul 28, 2023

cloud-provider-openstack can be configured to create security groups for the NodePorts of the load balancers it is creating. These SGs are then attached to the nodes. On cluster destroy we're orphaning them. This commit makes sure that we're looking for them.

As they aren't tagged or have a proper cluster ID in the name, we will look at each of the ports, list its SGs and evaluate them comparing names with the pattern. If it matches, destroy will attempt to delete such SG.

@dulek dulek force-pushed the remove-cpo-sgs branch 2 times, most recently from 77e3e52 to ce73a8a Compare July 28, 2023 14:57
@dulek
Copy link
Contributor Author

dulek commented Jul 28, 2023

If any of reviewers have a better idea how to find these SGs and not include any SG of other cluster I'd be grateful for advice.

@dulek
Copy link
Contributor Author

dulek commented Jul 31, 2023

/retest

gzip: invalid checksum.

// We'll look through the ones on each of the ports and attempt to remove it from the port and delete it.
// Most of the time it's a conflict, but last port should be guaranteed to allow deletion.
// TODO(dulek): Currently this is the only way to do it and if delete fails there's no way to get back to
// that SG. This is bad and we should make groups created by CPO tagged by cluster ID ASAP.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this issue being tracked somewhere so we don't forget about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.redhat.com/browse/OSASINFRA-3200. This is a broader problem really, we don't have a good way to distinguish LBs between clusters too and currently we can have clashes by names in CPO. :/

pkg/destroy/openstack/openstack.go Outdated Show resolved Hide resolved
cloud-provider-openstack can be configured to create security groups for
the NodePorts of the load balancers it is creating. These SGs are then
attached to the nodes. On `cluster destroy` we're orphaning them. This
commit makes sure that we're looking for them.

As they aren't tagged or have a proper cluster ID in the name, we will
look at each of the ports, list its SGs and evaluate them comparing
names with the pattern. If it matches, `destroy` will attempt to delete
such SG.
@MaysaMacedo
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2023
Copy link
Member

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mandre

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 1, 2023
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD a376ef5 and 2 for PR HEAD c89d3ac in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 2, 2023

@dulek: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openstack-nfv-intel c89d3ac link false /test e2e-openstack-nfv-intel

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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 4f59664 into openshift:master Aug 2, 2023
25 of 26 checks passed
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants