Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't specify the cniConfigDir when multus generate MultusCniConfig(00-multus.conf) #1365

Open
cyclinder opened this issue Dec 9, 2024 · 0 comments

Comments

@cyclinder
Copy link
Contributor

What happend:

I follow the doc: https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/deployments/multus-daemonset-thick.yml to install multus, the generated MultusCNI config is shown like:

{"capabilities":{"bandwidth":true,"portMappings":true},"cniVersion":"0.3.1","logLevel":"verbose","logToStderr":true,"name":"multus-cni-network","clusterNetwork":"/host/etc/cni/net.d/10-calico.conflist","type":"multus-shim"}

and I can't run a test pod:

Events:
  Type     Reason                  Age                     From     Message
  ----     ------                  ----                    ----     -------
  Warning  FailedCreatePodSandBox  2m37s (x677 over 175m)  kubelet  (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c1f1029bd7058fcce8d5dd71d0c5e976820863eeb10f7905976f408be8f63243": plugin type="multus-shim" name="multus-cni-network" failed (add): CmdAdd (shim): CNI request failed with status 400: 'ContainerID:"c1f1029bd7058fcce8d5dd71d0c5e976820863eeb10f7905976f408be8f63243" Netns:"/var/run/netns/cni-f042fa47-bf1c-1a81-b7b7-f8302b902d7f" IfName:"eth0" Args:"K8S_POD_UID=251c1c0c-730a-4ece-8ea4-c295010f97aa;IgnoreUnknown=1;K8S_POD_NAMESPACE=default;K8S_POD_NAME=test-pod-7b9bdd678f-2h7gc;K8S_POD_INFRA_CONTAINER_ID=c1f1029bd7058fcce8d5dd71d0c5e976820863eeb10f7905976f408be8f63243" Path:"" ERRORED: error configuring pod [default/test-pod-7b9bdd678f-2h7gc] networking: Multus: [default/test-pod-7b9bdd678f-2h7gc/251c1c0c-730a-4ece-8ea4-c295010f97aa]: error loading k8s delegates k8s args: TryLoadPodDelegates: error in getting k8s network for pod: GetNetworkDelegates: failed getting the delegate: GetCNIConfig: err in GetCNIConfigFromFile: No networks found in /etc/cni/multus/net.d
': StdinData: {"capabilities":{"bandwidth":true,"portMappings":true},"clusterNetwork":"/host/etc/cni/net.d/10-calico.conflist","cniVersion":"0.3.1","logLevel":"verbose","logToStderr":true,"name":"multus-cni-network","type":"multus-shim"}

No networks found in /etc/cni/multus/net.d: This means that multus look up the cni configs from /etc/cni/multus/net.d by default, but this dir don't be mounted to the multus pod, see

mountPath: /host/etc/cni/net.d
, also see #1362

I look at the code, I don't understand this:

// before marshal, flush variables which is not required for multus-shim config
, Is this to support the thin and thick plugins?

I think we should:

  1. Change the default cni config dir to /etc/cni/net.d
  2. Add support for configuring the cni config dir

What you expected to happen:

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

Anything else we need to know?:

Environment:

  • Multus version
    image path and image ID (from 'docker images')
  • Kubernetes version (use kubectl version):
  • Primary CNI for Kubernetes cluster:
  • OS (e.g. from /etc/os-release):
  • File of '/etc/cni/net.d/'
  • File of '/etc/cni/multus/net.d'
  • NetworkAttachment info (use kubectl get net-attach-def -o yaml)
  • Target pod yaml info (with annotation, use kubectl get pod <podname> -o yaml)
  • Other log outputs (if you use multus logging)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant