-
Notifications
You must be signed in to change notification settings - Fork 261
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
Instance.IP is set randomly when a server has multiple networks #926
Comments
looks like the code you pointed out seems you are right, the last one will be selected but I think floating ip in current implementation is mandatory? if so if we have 2 networks then |
The former identifies the IP of a load balancer member. The latter is the only address of type If it lands, #924 adds a third use: to identify the port we should associate with a floating IP. On However, we'd need somewhere to put them. The 2 remaining uses are:
How about the following logic for this IP:
|
If we merge #971 I believe we can address this by changing the signature of
OpenStackMachine and OpenStackClusterStatus as arguments. This would allow us to implement the logic described in #926 (comment).
|
This was close accidentally, and I can't reopen it 🤔 |
/reopen |
@tobiasgiese: Reopened this issue. In response to this:
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. |
@mdbooth you should never write the issue number and |
I'm not sure this is entirely a Cluster API provider issue. Detecting the IP for the API load-balancer member definitely is, but for the node IP as it appears in Kubernetes, I think the OpenStack Cloud Controller Manager will override whatever Cluster API passes (not to say that we shouldn't make it deterministic/configurable anyway, of course!). To that end, I notice in your templates that you are still using the deprecated in-tree OpenStack CCM. By using the newer out-of-tree external CCM, you get to use the configuration option I have this working quite smoothly in the case where the control plane nodes share a VXLAN with the workers, but the workers are also attached to a VLAN with SR-IOV enabled. I can tell the OpenStack CCM to use the VXLAN as the Kubernetes node IP. |
I need to fix this issue in CAPO due to how we use it in OpenShift. The interaction with in-tree/CCM cloud provider isn't my concern here. |
/kind bug
This is from code inspection while working on MAPO: https://github.com/shiftstack/machine-api-provider-openstack
There is no reproducer, I could have misread the code, and/or this may not be relevant to CAPO.
The problem is where we're iterating over a server's Addresses in here: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/master/pkg/cloud/services/compute/instance.go#L916-L930
If the server has multiple networks we will return the last one returned by the API which is not a floating IP as the machine's control plane IP.
The problem here is that as this interface is currently used it doesn't have enough context to determine which network of multiple networks is the control plane network. When we call GetInstance() or InstanceExists() we're passing in an OpenStack identifier. However, to determine which is the control plane IP we additionally need to know which is the control plane network. AFAICT the canonical reference for this would be OpenStackMachine.Spec.Subnet.
I'm currently thinking of a refactor. I think serverToInstance() needs this additional context. I also note that GetIPFromInstance is called by an E2E test, and duplicates a bunch of code. I wonder if it might be cleaner to have it use an exported serverToInstance instead. I haven't got a firm plan in mind, yet.
The text was updated successfully, but these errors were encountered: