k8snetworkplumbingwg / multus-cni

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

multus-cni with --multus-master-cni-file-name start error #759

Closed JornShen closed 2 years ago

JornShen commented 2 years ago
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: kube-multus-ds
  namespace: kube-system
  labels:
    tier: node
    app: multus
    name: multus
spec:
  selector:
    matchLabels:
      name: multus
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        tier: node
        app: multus
        name: multus
    spec:
      hostNetwork: true
      tolerations:
      - operator: Exists
        effect: NoSchedule
      serviceAccountName: multus
      containers:
      - name: kube-multus
        image: cr-stg-cn-beijing.volces.com/vke/multus-cni:v3.7.2
        command: ["/entrypoint.sh"]
        args:
        - "--multus-conf-file=auto"
        - "--cni-version=0.3.1"
        - "--multus-master-cni-file-name=10-flannel.conflist"

and get error

root@node-wsrbbg:~# crictl logs 149cccd0da497
2021-11-15T13:57:12+0000 Generating Multus configuration file using files in /host/etc/cni/net.d...
cat: /host/etc/cni/net.d//host/etc/cni/net.d/10-flannel.conflist: No such file or directory
Traceback (most recent call last):
  File "/tmp/tmp.yzlqNtK4QC", line 2, in <module>
    conf = json.load(sys.stdin)
  File "/usr/lib64/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

and ls my path

root@node-wsrbbg:~# ls -l /etc/cni/net.d/
total 11
-rw-r--r-- 1 root root  292 Oct 12 20:18 10-flannel.conflist
drwxr-xr-x 2 root root 4096 Nov 15 22:00 multus.d
JornShen commented 2 years ago

version is v3.7.2

maiqueb commented 2 years ago

I think this PR fixed this issue.

@JornShen can you update to v.3.8.0 ?

@dougbtv should we back-port that into release-3.7 ?

JornShen commented 2 years ago

yeh, I updated, and it works. I think it rebase to release-3.7 ? @maiqueb

dougbtv commented 2 years ago

We recommend updating to 3.8.0+, thanks for the report as well.