-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: Fix cluster floating ips #8115
Openstack: Fix cluster floating ips #8115
Conversation
Hi @mitch000001. 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 Once the patch is verified, the new status will be reflected by the 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. |
Could you please tell the use-case for this? This whole if loop should handle loadbalancer ip addresses, NOT instance addresses. What is the thing that is not working currently? I am just worrying that this PR will break things like using old neutron lbaas. Also I am not sure does this work with octavia either |
@zetaab The problem is that the current logic is connecting Floating IPs with Loadbalancers by their virtual IP. Having multiple networks with the same IP ranges in one project can lead to Loadbalancers having the same private IP they point to but within different networks. This fix mitigates that by using the Loadbalancer id stored within the FloatingIP |
ef46c39
to
b0b080e
Compare
Having said that, |
Another solution than the used one in this PR is to filter all LoadBalancers by their subnet/network to use the appropriate ones. I am also fine with that solution. In either way the current solution leads to bad side effects which we have to fix. |
b0b080e
to
ff3616d
Compare
ff3616d
to
c286865
Compare
@zetaab btw: we are using neutron loadbalancers. For them, this change is working fine. How it will behave on octavia I cannot tell. |
ok I will test this tomorrow |
/ok-to-test |
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.
this does not work for octavia loadbalancers:
% ./kops export kubecfg --name xjxjjx.k8s.local -v 2
I1217 13:13:43.469803 59537 factory.go:68] state store do://kopstest
I1217 13:13:44.400841 59537 cloud.go:354] authenticating to keystone
I1217 13:13:44.883163 59537 cloud.go:458] Openstack using Octavia lbaasv2 api
I1217 13:13:44.883226 59537 cloud.go:632] Querying Openstack to find Loadbalancers for API ("xjxjjx.k8s.local")
W1217 13:13:47.152999 59537 create_kubecfg.go:76] Did not find API endpoint for gossip hostname; may not be able to reach cluster
kops has set your kubectl context to xjxjjx.k8s.local
without this change I can find the hostname and everything works like should
Added debug for that:
W1217 13:13:47.152801 59537 cloud.go:648] DEBUG3 dbab1a38-faa5-49df-98bc-f638d057a96f lb-dbab1a38-faa5-49df-98bc-f638d057a96f
So when lb.ID is dbab1a38-faa5-49df-98bc-f638d057a96f
the fip.InstanceID is lb-dbab1a38-faa5-49df-98bc-f638d057a96f
so the floatingip instanceid contains prefix lb-
which should be ignored in case of octavia
Given that fact I would propose another way of implementing it. The problem currently for us is that there are IP clashes between LoadBalancers. So if we add a filter for the loadbalancer to make sure it is originating from the proper subnet/network we should be able to leave the implementation with IP addresses as is. |
Thinking more about it the just proposed solution does not work, because we iterate over FloatingIPs and there is the problem of identification, not at the LoadBalancer side. So in oder to get it working we have to use the prefix strip approach, although it is not pleasing to me and feels brittle. |
I will try to use parts of the implementation of https://github.com/kubernetes/kops/blob/master/upup/pkg/fi/cloudup/openstacktasks/floatingip.go#L85-L121 where we already connect LoadBalancers and FloatingIPs. Possibly a good idea to reuse knowledge. |
c286865
to
bbb78c6
Compare
bbb78c6
to
66edc1f
Compare
/retest |
66edc1f
to
ebc117b
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mitch000001, zetaab 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 |
/test pull-kops-verify-govet |
…115-origin-release-1.16 Automated cherry pick of #8115 Openstack: Fix cluster floating ips
…115-origin-release-1.15 Automated cherry pick of #8115 Openstack: Fix cluster floating ips
…115-origin-release-1.17 Automated cherry pick of #8115 origin release 1.17
This fixes an issue when we have multiple floating IPs which have the same virtual IPs but point to different networks.