k8snetworkplumbingwg / ovs-cni

Open vSwitch CNI plugin
Apache License 2.0
218 stars 70 forks source link

Allowing users to specify custom `external-id` #291

Open mnaser opened 10 months ago

mnaser commented 10 months ago

I have a scenario where I'd like to add a bunch of values to external-ids (because my OVS bridge is tapped into OVN and I'd like to set iface-id).

It doesn't seem like there's a way to do it right now, am I missing something to allow this or is this not part of the ovs-cni scope?

phoracek commented 10 months ago

Hey @mnaser! Do you want to set external-ids on Bridge, Port, or Interface object?

mnaser commented 4 months ago

Hi @phoracek -- sorry, better late than ever. We'd want to put it on the Interface, so for example, we do this right now inside of a VM that's running in host networking mode:

ovs-vsctl --may-exist add-port br-int o-hm0 \
        -- set Interface o-hm0 type=internal \
        -- set Interface o-hm0 external-ids:iface-status=active \
        -- set Interface o-hm0 external-ids:attached-mac=$HM_PORT_MAC \
        -- set Interface o-hm0 external-ids:iface-id=$HM_PORT_ID \
        -- set Interface o-hm0 external-ids:skip_cleanup=true

We would really like/rather than instead, we relied on the OVS CNI somehow :)

phoracek commented 3 months ago

@mnaser iface-id can be already configured by setting ovnPort in CNI_ARGS. The rest of the attributes however is not available.

I would be happy to accept a patch that extends the API in the following way:

That way it will be possible for the user to request any external-id as long as it was allowed by the administrator in the network configuration.

cc @SchSeba