piraeusdatastore / piraeus-operator

The Piraeus Operator manages LINSTOR clusters in Kubernetes.
https://piraeus.io/
Apache License 2.0
409 stars 64 forks source link

Unable to change satellite ip address #735

Open paraddise opened 1 week ago

paraddise commented 1 week ago

I have kubernetes node with 2 interfaces, 1 for use with kubernets, another is infiniband interface for drbd traffic only. I have external linstor controller and piraes deployed to kubernetes. Currently piraeus when creating satellite in controller takes ip from status.nodeIPs of Pod. So I can't change IP address of registered satellite. I propose to create field in LinstorSatelliteConfiguration where you can pass interface name or IP address of sattelite that will be created.

paraddise commented 6 days ago

Found workaround

  1. You: Adding new node to kubernets
  2. Operator: creates satellite in controller
  3. You: Adding new interface ib0 via `linstor n i create ib0 ...
  4. You: Changing LinstorSatelliteConfiguration and adding PrefNic=ib0
  5. Operator: updates Node Properties in Linstor Controller

Now, I'm searching the way to automate this at node registration at linstor.

Maybe there are plans to add Interfaces in LinstorSatelliteConfiguration?

WanzenBug commented 1 day ago

Currently, the Operator is the one registering the Satellites. So it can only really use what Kubernetes exposes on the Pod (perhaps also on the K8s Node resource). So we would need a way to expose the IP address of this secondary interface to Kubernetes, and then a way for the Operator to pick up this information.

You could probably somehow coble together an initContainer using the LinstorSatelliteConfiguration.spec.podTemplate that scans the output of ip addr show dev ... and registers that interface on Pod startup.

paraddise commented 1 day ago

I haven't thought about patches, thank you, will try it