k8snetworkplumbingwg / multus-cni

A CNI meta-plugin for multi-homed pods in Kubernetes
Apache License 2.0
2.29k stars 575 forks source link

Thick plugin: Add configuration options in documentation to configure Master CNI #1237

Open raghs-aws opened 4 months ago

raghs-aws commented 4 months ago

What happend: Thick plugin doesn't set the master cni or the default cni, and keeps "multusConfigFile": "auto". This causes Multus to pick other cnis than primary-cni in some cases , if we have some other cnis installed like istio-cni.

What you expected to happen:

There should be an option to keep Master CNI defined to avoid multus accidently picking other cnis if there are more than 1 cnis in the path.

How to reproduce it (as minimally and precisely as possible):

install istio-cni with hostNetwork enabled

  # Configure ambient settings
  ambient:
    # If enabled, ambient redirection will be enabled
    enabled: true
    # Set ambient redirection mode: "iptables" or "ebpf"
    redirectMode: "iptables"

Anything else we need to know?:

we can override the behavior if add "multusMasterCNI" in the daemon-config. below is an option (in this case its vpc-cni)

    "multusMasterCNI": "10-aws.conflist"

i dont see documentation mentioning this for thick plugin. request is to update this in the Thick plugin documentation and/or configuration documentation, so that users are aware how to override the auto selection of primary cni.
Environment:

raghs-aws commented 4 months ago

if needed, I can create a PR to update the documentation.

dougbtv commented 4 months ago

Thanks Raghs -- can you provide a documentation update PR and we can continue the discussion there? Thanks!

raghs-aws commented 4 months ago

Thanks @dougbtv . opened a PR : https://github.com/k8snetworkplumbingwg/multus-cni/pull/1245

raghs-aws commented 3 months ago

@dougbtv Could you please review the above PR.

abasitt commented 2 months ago

@raghs-aws thank you for sharing about this, I was looking in to migration from thin to thick plugin and was wondering exactly about this master-cni configs in the thick plugin. Is this understanding correct?. thinplugin clusterNetwork= thinkplugin multusMasterCNI

what is equivalent to defaultnetworks in thickplugin configs ? and wondering if auto can be disabled ?

abasitt commented 2 months ago

Seems like there are are also manual options for masternetwork even in thick plugin, but still good to know about this flag to use if multusconfigs are set for auto. Anyway will play around with thick plugin to explore it.

raghs-aws commented 2 months ago

yes in old thin plugin it was multus-master-cni-file option. This flag multusMasterCNI with your primary CNI was the solution. we used and running it in our environment. This solved the race condition between istio and primary CNI, you can use auto and which is fine for other configs. i tried a few other configs like clusterNetwork etc, but somehow didnt help. My PR for documentation update is pending in review.