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

plugin type="calico" failed (add): invalid character 'd' looking for beginning of value #1330

Open
13567436138 opened this issue Sep 6, 2024 · 0 comments

Comments

@13567436138
Copy link

What happend:

 Warning  FailedCreatePodSandBox  4s    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "cc39aedf1e6180082fafb684f1fac6813f3c208e92c2e1633a5e398c0685182c": plugin type="multus" name="multus-cni-network" failed (add): [default/samplepod/8aaace7d-f22c-429d-8191-1d160e92c130:k8s-pod-network]: error adding container to network "k8s-pod-network": plugin type="calico" failed (add): invalid character 'd' looking for beginning of value
apiVersion: projectcalico.org/v3
kind: IPPool
metadata:
  name: my-ip-pool
  namespace: kube-system
spec:
  cidr: 192.168.0.0/16         # 你的 IP 范围
  ipipMode: Always             # IPIP 模式
  natOutgoing: true            # 启用 NAT
  blockSize: 26                # 块大小
cat <<EOF | kubectl create -f -
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: flannel-conf
spec: 
  config: '{
    "cniVersion": "0.3.1",
    "type": "flannel",
    "delegate": {
      "isDefaultGateway": true
    }
  }'
EOF
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Pod
metadata:
  name: samplepod
  annotations:
    k8s.v1.cni.cncf.io/networks: default/flannel-conf
spec:
  containers:
    - name: nginx-container
      image: nginx:latest
      ports:
        - containerPort: 80
      volumeMounts:
        - name: nginx-storage
          mountPath: /usr/share/nginx/html
  volumes:
    - name: nginx-storage
      emptyDir: {}
EOF
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Pod
metadata:
  name: samplepod
  annotations:
    cni.projectcalico.org/ipv4pools: "default-ipv4-ippool"
    k8s.v1.cni.cncf.io/networks: default/flannel-conf
spec:
  containers:
    - name: nginx-container
      image: nginx:latest
      ports:
        - containerPort: 80
      volumeMounts:
        - name: nginx-storage
          mountPath: /usr/share/nginx/html
  volumes:
    - name: nginx-storage
      emptyDir: {}
EOF

with cni.projectcalico.org/ipv4pools: "default-ipv4-ippool" got error ,without no error?

What you expected to happen:

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

Anything else we need to know?:

Environment:

  • Multus version latest
    image path and image ID (from 'docker images')
  • Kubernetes version (use kubectl version):1.31.0
  • Primary CNI for Kubernetes cluster:calico
  • OS (e.g. from /etc/os-release):ubuntu2404
  • 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
Projects
None yet
Development

No branches or pull requests

2 participants