-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Don't recreate lb cloud resources on kcm restart #29082
Conversation
@@ -760,20 +766,29 @@ func (gce *GCECloud) forwardingRuleNeedsUpdate(name, region string, loadBalancer | |||
if isHTTPErrorCode(err, http.StatusNotFound) { | |||
return false, true, "", nil | |||
} | |||
return false, false, "", fmt.Errorf("error getting load balancer's forwarding rule: %v", err) | |||
// Err on the side of caution in case of errors. Caller should notice the error and retry. | |||
// We never want to end up recreting resources because gce api flaked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/recreting/recreating
} | ||
if translateAffinityType(affinityType) != tp.SessionAffinity { | ||
// TODO: This is fickle, if either side changes defaults it could backfire. | ||
if tp.SessionAffinity != "" && translateAffinityType(affinityType) != tp.SessionAffinity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one. I think SessionAffinity == "" might be equivalent to SessionAffinity NONE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safety first? this will just prevent the resync for session affinity. or would you prefer treating empty as none?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, can we get clarity on that and document it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you comnment this REALLY REALLY well, please? Explain what we're checking and why.
lgtm except the SessionAffinity question. |
// TODO: we report loadbalancer IP through status, so we want to verify if | ||
// that matches the forwarding rule as well. | ||
if loadBalancerIP != "" && loadBalancerIP != fwd.IPAddress { | ||
glog.Warningf("Loadbalancer ip for forwarding rule %v changed from %v to %v", fwd.Name, fwd.IPAddress, loadBalancerIP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"changed" is misleading. maybe "was expected to be %v, but was actually %v"
My comments are all log messages or comments, so you can LGTM when done. |
Comments addressed, applying LGTM as discussed. My "emptystring is not None" assertion also means that users won't be able to move out of "None" for session affinity as long the gce api keeps returning the empty string. |
Did we confirm experimentally what GCE returns for that field? If we feed it NONE what do we get back? |
LGTM. The TP thing skeeves me out. |
My UI has
But even clickin on "show as json" I don't get the field. |
not sure what the build failures about, rebased and trying again |
GCE e2e build/test passed for commit a9426a1. |
Automatic merge from submit-queue |
Commit found in the "release-1.3" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
…pick-of-#29082-upstream-release-1.3 Automatic merge from submit-queue Automated cherry pick of kubernetes#29082 Cherry pick of kubernetes#29082 on release-1.3.
Absolute dumbest way to fix it right now.
Fixes #29079