ironcore-dev / metalnet

Kubernetes controller managing dpservice networking resources
Apache License 2.0
0 stars 2 forks source link

Research how a network interface could be removed from loadbalancing without changing user-facing onmetal objects (LB/machine) #42

Open KapilYadava opened 1 year ago

KapilYadava commented 1 year ago

Had discussion today with onmetal-api and virtualization team

Further discussion

  1. Relation between on-metal api LB and metal-net LB.
  2. To look into meta-lnet load balancer with virtualization team
  3. To look into on-metal API LB and LBR with on-metal api team

Solution:

  1. Add Watches to setUpManager() which can help us to identify the VM status and the NIC name.

Watches( &source.Kind{Type: &computev1alpha1.Machine{}}, handler.Funcs{ UpdateFunc: func(event event.UpdateEvent, queue workqueue.RateLimitingInterface) { machine := event.ObjectNew.(*computev1alpha1.Machine) for _, nic := range machine.Spec.NetworkInterfaces { queue.Add(ctrl.Request{NamespacedName: types.NamespacedName{Name: nic.Name}}) } } }, }, ).

  1. Update destinations in LoadBalancerRouting when reconcile triggered
KapilYadava commented 1 year ago

Update from today meeting

  1. Update the network interface status or add status field (Machine Status) to create a relation (health check label) between Machine and network interface. (virtlet)

something like this:

apiVersion: networking.api.onmetal.de/v1alpha1 kind: NetworkInterface metadata: name: networkinterface-1 spec: networkRef: name: network-1 // to be updated status: MachineRef: name: vm-1 status: Running

[Monday 14:31] Stößel, Manuel

Hi Kapil, I don't think you really need point 1, you already have a machineref in the networkinterfacespec as we saw in the code. If that's used, every controller can just look up the status of the referenced machine itself. I don't think we need to copy a machineref plus machine status to the networkinterface status. But maybe I didn't completely understood what your reasons were for that.

point 1 is not needed

  1. Add watches function to setUpManager() in LB controller to watch network interface status and filter out NICs on the basis of network interface networkInterface.Status.MachineRef.status. (onmetal-api)

  2. Update NICs in LBR object at reconcile loop. (onmetal-api)

KapilYadava commented 1 year ago

Implementation is done: https://github.com/onmetal/onmetal-api/compare/feature/lb_health_check?expand=1

waiting for lab access to onmetal-api cluster

LanDeleih commented 1 year ago

Greetings, May I inquire as to what assistance you require from us?

KapilYadava commented 1 year ago

@LanDeleih, I need to access to the test lab so that I can deploy change to onmetal-api cluster, controller to be deployed.

LanDeleih commented 1 year ago

@LanDeleih, I need to access to the test lab so that I can deploy change to onmetal-api cluster, controller to be deployed.

Hello. Regarding the issue created in our repository, please allow me to clarify that our team is not responsible for onmetal-api or the test environment. Do you need us to make a feature for baremetal servers? If that is indeed what you require, could you specify what exactly you need us to implement?

KapilYadava commented 1 year ago

@LanDeleih it is not the right repo actually, as per our recent discussion I think this issue will be moved to dp-service. Is possible to change repo now ? I tried but I could not do that.

guvenc commented 1 year ago

This is not dp-service related. Please talk to me first before moving issues to dp-service. @LanDeleih @KapilYadava Please remove this one from dp-service and move it to metalnet and please clarify what is the problem and what is being tried to be done here.

PlagueCZ commented 1 year ago

As discussed with @KapilYadava, removing of LBs is already supported in dp-service. It is on the orchestration to actually do it based on health checks. One possible solution is to implement it in metalbond with a tiny change to metalnet, but that is not something that can be decided in this (dp-service) project.