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

How to use host-device plugin inside microk8s #1209

Closed
kouamdo opened this issue Jan 15, 2024 · 1 comment
Closed

How to use host-device plugin inside microk8s #1209

kouamdo opened this issue Jan 15, 2024 · 1 comment

Comments

@kouamdo
Copy link

kouamdo commented Jan 15, 2024

Hi , since , i'm trying to make a simple config.
so, using this config :

cat <<EOF | kubectl create -f -
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: macvlan-conf-1
spec:
  config: '{
            "cniVersion": "0.3.1",
            "type": "host-device",
            "device": "eth0"
        }'
--- 
apiVersion: v1
kind: Pod
metadata:
  name: pod-case-01
  annotations:
    k8s.v1.cni.cncf.io/networks: macvlan-conf-1
spec:
  containers:
  - name: pod-case-01
    image: docker.io/centos/tools:latest
    command:
    - /sbin/init
EOF

i have getting this error :

Warning FailedCreatePodSandBox 2m17s (x930 over 27m) kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "ba1cdf53d8de5004b0eb3f22e21c22b9014b563a8d118696fa209d46894e6740": plugin type="multus" name="multus-cni-network" failed (add): [default/pod-case-01/35f7a2f3-e44b-4f49-9d8c-ef3bbb911a91:macvlan-conf-1]: error adding container to network "macvlan-conf-1": failed to move link file exists

image

so i'm using

  • calico as primary CNI
  • multus version: 0.3.1
  • kubernetes version : 1.28.3
  • multus config :
{
  "cniVersion": "0.3.1",
  "name": "multus-cni-network",
  "type": "multus",
  "capabilities": {
    "portMappings": true,
    "bandwidth": true
  },
  "kubeconfig": "/var/snap/microk8s/current/args/cni-network/multus.d/multus.kubeconfig",
  "delegates": [
    {
      "name": "k8s-pod-network",
      "cniVersion": "0.3.1",
      "plugins": [
        {
          "type": "calico",
          "log_level": "info",
          "log_file_path": "/var/snap/microk8s/common/var/log/calico/cni/cni.log",
          "datastore_type": "kubernetes",
          "nodename": "k8s-ashburn",
          "nodename_file": "/var/snap/microk8s/current/var/lib/calico/nodename",
          "mtu": 0,
          "ipam": {
            "assign_ipv4": "true",
            "type": "calico-ipam"
          },
          "policy": {
            "type": "k8s"
          },
          "kubernetes": {
            "kubeconfig": "/var/snap/microk8s/current/args/cni-network/calico-kubeconfig"
          }
        },
        {
          "type": "portmap",
          "snat": true,
          "capabilities": {
            "portMappings": true
          }
        },
        {
          "type": "bandwidth",
          "capabilities": {
            "bandwidth": true
          }
        }
      ]
    }
  ]
}

so please , where i have mistaken ?

@kouamdo
Copy link
Author

kouamdo commented Jan 15, 2024

Thank you too , ...
The issue it was that i could change the interface inside the net-attach-def.

So just to change eth0 by another free interface like esp for exemple

@kouamdo kouamdo closed this as completed Jan 15, 2024
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