k8snetworkplumbingwg / multus-cni

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

apply multus-cni unexpected EOF #1340

Open 120L020314 opened 2 weeks ago

120L020314 commented 2 weeks ago

I first apply the plugin,it works successfully:

kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset.yml

but when i second apply:

kubectl apply -f multi.yaml

it shows error:

error: error when creating "multi.yaml": Post "https://192.168.31.105:8443/apis/k8s.cni.cncf.io/v1/namespaces/default/network-attachment-definitions?fieldManager=kubectl-client-side-apply": unexpected EOF

multi.yaml: apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: macvlan-conf spec: config: '{ "cniVersion": "0.3.1", "type": "macvlan", "master": "ens33", "mode": "bridge", "ipam": { "type": "host-local", "subnet": "192.168.31.0/24", "rangeStart": "192.168.31.106", "rangeEnd": "192.168.31.206", "gateway": "192.168.31.2", "routes": [ { "dst": "0.0.0.0/0" } ] } }'

my cluster: root@m-01:/home/m-01/Downloads/testyaml# kubectl get node NAME STATUS ROLES AGE VERSION m-01 Ready 173d v1.22.10 n-01 NotReady 173d v1.22.18-rc.0.1+bc4763cbf8b9e6-dirty n-02 Ready 173d v1.22.18-rc.0.1+bc4763cbf8b9e6-dirty

my default cni plugin: { "name": "cbr0", "cniVersion": "0.3.1", "type": "flannel", "delegate": { "hairpinMode": true, "isDefaultGateway": true, "hairpinMode": true, "isDefaultGateway": true, "type": "bridge", "bridge": "cni0", "isGateway": true, "ipMasq": true, "mtu": 1450 },
"ipam": { "type": "host-local", "ranges": [ [ { "subnet": "10.244.0.0/12" } ] ] } }

i needs my pod to have two ip,how can i solve this problem?

dougbtv commented 1 day ago

run that through a yaml linter and see what you get, too

120L020314 commented 1 day ago

run that through a yaml linter and see what you get, too

image it returns nothing