networkservicemesh / deployments-k8s

Apache License 2.0
42 stars 34 forks source link

Feature: configure datapath for networkservice via defined forwarder interface #10024

Open barby1138 opened 1 year ago

barby1138 commented 1 year ago

Hi guys Another feature is missing for me is subj My vision for implementation: Example:

we have ability to configure selector in forwarder: for node/cluster1

---
interfaces:
  - name: int1
    matches:
       - labelSelector:
           - via: gw1

for node/cluster2

---
interfaces:
  - name: int2
    matches:
       - labelSelector:
           - via: gw1

And Im aware that int1 coonected to int2 via router. So I want data path to be routed via those interfaces. So...

for networkservice declaration I want to add gw_selector field:

Example:

apiVersion: networkservicemesh.io/v1
kind: NetworkService
metadata:
  name: registry-local-endpoint
spec:
  payload: ETHERNET

  matches:
  - routes:
    - destination_selector:
        app: nse-1
    source_selector: null
    gw_selector: gw1

What do you think? Thank you!!! Have a nice day!!!

glazychev-art commented 1 year ago

Hello @barby1138, Thanks for the report!

In fact, we have the opportunity to use any host interface for the forwarder: for this we need to specify the NSM_TUNNEL_IP env. For example:

            - name: NSM_TUNNEL_IP
              value: "192.168.0.2"

The forwarder will automatically select the interface that has this IP. (see also https://github.com/networkservicemesh/deployments-k8s/blob/main/apps/forwarder-vpp/forwarder.yaml#L32-L35)

But this interface will be used for all connections (any NetworkServices). Will this be enough for you? Or do you want to use different interfaces for different services?

barby1138 commented 1 year ago

Hi Artem

Yes exactly Ex usecase. I could have different "networks" for my services - like management plane and data plane. So for better/more optimal resource usage I d like to split paths. use kernel int for management and dpdk VF for data. Also data throughput could be too high to put to 1 interface so I d need to split data to several ints.

Thanks for your work!!! Have a good day!!!

edwarnicke commented 1 year ago

@barby1138 Its interesting you arrived at this problem. I'd sort of thought of something similar before, where the forwarder connects to some set of 'network services' and you reach another network service 'via' one of those. Does that way of thinking of things match where you are going? Its a bit more abstract than just being interface or network oriented... but can scoop up those use cases :)