Floating IPs to virtual machines in CAPO #1535
Replies: 3 comments
-
We don't really use Discussions yet in CAPO. This is interesting, but there isn't really an action associated with it. Would you like to try opening it as a discussion instead? |
Beta Was this translation helpful? Give feedback.
-
If you did want to turn it into something actionable, I'm not really comfortable with how we currently pick a target port for floating ip association. I would like something more explicit, but not so complicated it's un-ergonomic. Is there ever a case where you might want to support multiple external networks connecting to multiple local ports? You'll be the first, but I would like to try moving this to discussions and creating an issue for anything actionable. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the good summary, saw a lot of files/actions listed , do you have specific goal or TODOs or just want to make it clear so we can find some optimize point? |
Beta Was this translation helpful? Give feedback.
-
I would like to know how CAPO allocates Floating IPs to virtual machines. To investigate this, I looked into the situations in which the AssociateFloatingIP function is called. Here are my findings, but I lack understanding and would appreciate some advice or guidance on which code files to examine further.
AssociateFloatingIP
floatingip.go
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/25472728f74d30a8188a969e2cd6a3c40c78e0f8/pkg/cloud/services/networking/floatingip.go
Summary:
Associate a Floating IP with a port ID and assign it to a virtual machine in CAPO.
Overview of AssociateFloatingIP processing
Functions referenced by AssociateFloatingIP
AssociateFloatingIP is called in the following three functions:
reconcileBastion:
Uses the GetOrCreateFloatingIP function to obtain a FloatingIP, and the computeService.GetManagementPort function to obtain the bastion's ManagementPort, then associates the FloatingIP with the bastion's ManagementPort using AssociateFloatingIP.
reconcileNormal:
Uses the GetOrCreateFloatingIP function to obtain a FloatingIP, and the computeService.GetManagementPort function to obtain the instance's ManagementPort, then associates the FloatingIP with the instance's ManagementPort using AssociateFloatingIP.
ReconcileLoadBalancer:
LoadBalancer uses a FloatingIP if:
openStackCluster.Spec.DisableAPIServerFloatingIP is false
openStackCluster.Spec.APIServerFloatingIP is not empty, or openStackCluster.Spec.ControlPlaneEndpoint is valid, set floatingIPAddress.
If these conditions are met, call the GetOrCreateFloatingIP function to obtain a FloatingIP, and use the AssociateFloatingIP function to associate lb.VipPortID with it, defining the obtained FloatingIP value as lbFloatingIP.
Beta Was this translation helpful? Give feedback.
All reactions