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

Do not Delete LB in Case of Security Group Reconciliation Errors #743

Merged

Conversation

multi-io
Copy link
Contributor

@multi-io multi-io commented Sep 3, 2019

What this PR does / why we need it:

This fixes the lbaas control loop's EnsureLoadBalancer() function so it no longer deletes the LB if something went wrong when reconciling the LB's security groups. With the current master, if you have an LB service and associated LB already up and running and working fine, and then during a reconcile loop (which shouldn't change anything) e.g. the OpenStack API is down temporarily at the wrong moment (i.e. if it's still up during the LB and listener reconciliation, but then down during the SG reconciliation), then the whole LB will be deleted. We saw this exact thing happen in a real world customer application, which went offline because of if (the LB is recreated shortly after, but likely with a different floating IP).

Deleting the LB in case of errors in a "reconcile" (rather than "create") function seems just wrong, and all the other parts of EnsureLoadBalancer() don't do it either: E.g. if a transient error occurs when creating a listener, we just return it and leave the LB in a half-created state (

if err != nil {
// Unknown error, retry later
return nil, fmt.Errorf("error creating LB listener: %v", err)
}
), and the service controller will catch that error and re-queue the work item (https://github.com/kubernetes/kubernetes/blob/3fe7a570001ae0a6773da34a2eee7246ef416094/pkg/controller/service/service_controller.go#L255-L256) so the LB creation will go through eventually.

This PR just fixes the SG reconciliation to follow the same pattern. It seems to me that the current "delete LB in case an an error" approach was originally not part of a "reconcile" function but of a "create" function, where it would've made more sense.

The same bug is present in the legacy in-tree openstack cloud provider; I've submitted a corresponding PR there (kubernetes/kubernetes#82264).

Which issue this PR fixes

kubernetes/kubernetes#35056

Special notes for your reviewer:

Release note:

Do not delete managed LB in case of security group reconciliation errors

@k8s-ci-robot
Copy link
Contributor

Welcome @multi-io!

It looks like this is your first PR to kubernetes/cloud-provider-openstack 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-openstack has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 3, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @multi-io. Thanks for your PR.

I'm waiting for a kubernetes 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 Sep 3, 2019
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 3, 2019
@multi-io multi-io changed the title do not delete LB in case on security group reconciliation errors do not delete LB in case of security group reconciliation errors Sep 3, 2019
@multi-io multi-io changed the title do not delete LB in case of security group reconciliation errors Do not Delete LB in Case of Security Group Reconciliation Errors Sep 3, 2019
@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@ramineni
Copy link
Contributor

ramineni commented Sep 3, 2019

/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 Sep 3, 2019
@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@multi-io multi-io force-pushed the openstack_dont_delete_lb_on_errors branch from afd44da to 0942580 Compare September 3, 2019 11:03
@multi-io
Copy link
Contributor Author

multi-io commented Sep 3, 2019

force-pushed commit message typo fix

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@multi-io multi-io force-pushed the openstack_dont_delete_lb_on_errors branch from 0942580 to f365c4e Compare September 3, 2019 12:18
@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@multi-io
Copy link
Contributor Author

multi-io commented Sep 3, 2019

force-pushed better error message. I'll stop pushing now unless asked to do it.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 3, 2019

Build succeeded.

@lingxiankong
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 3, 2019
@adisky
Copy link
Contributor

adisky commented Sep 5, 2019

/approve
@lingxiankong do you want it to merge manually??

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adisky

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 Sep 5, 2019
@lingxiankong
Copy link
Contributor

/approve
@lingxiankong do you want it to merge manually??

Yes please, I don't think the CI job failure is related to this PR.

@lingxiankong
Copy link
Contributor

/approve
@lingxiankong do you want it to merge manually??

BTW, is there someone working on fixing the CI?

@adisky
Copy link
Contributor

adisky commented Sep 6, 2019

/approve
@lingxiankong do you want it to merge manually??

BTW, is there someone working on fixing the CI?

@lingxiankong for conformance we are working, openlab team is looking on octavia job

@adisky adisky merged commit a452516 into kubernetes:master Sep 6, 2019
powellchristoph pushed a commit to powellchristoph/cloud-provider-openstack that referenced this pull request Jan 19, 2022
…e_lb_on_errors

Do not Delete LB in Case of Security Group Reconciliation Errors
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants