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

does anyone have any guide or know if multus works with Racher k3s? #549

Closed
sardella opened this issue Aug 27, 2020 · 3 comments
Closed

Comments

@sardella
Copy link

does anyone have any guide or know if multus works with Racher k3s?

Thanks

@sardella
Copy link
Author

My pod never launches and I get validateIfName: interface name net1 already exists

Normal Scheduled default-scheduler Successfully assigned default/samplepod to localhost.localdomain
Normal AddedInterface 9s multus Add eth0 [10.42.0.2/24]
Normal AddedInterface 9s multus Add net1 [] from default/macvlan-conf
Normal AddedInterface 9s multus Add eth0 [10.42.0.2/24]
Warning FailedCreatePodSandBox 9s kubelet, localhost.localdomain Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "6680c8253a85b20d0b5e21e95ae1ba7a0a2d85cd91ac621c40e2da5dd454f025": [default/samplepod:macvlan-conf]: error adding container to network "macvlan-conf": delegateAdd: cannot set "" interface name to "net1": validateIfName: interface name net1 already exists

/etc/cni/net.d/70-multus.conf
{
"name": "multus-cni-network",
"type": "multus",
"logFile": "/var/log/multus.log",
"logLevel": "debug",
"readinessindicatorfile": "/var/run/flannel/subnet.env",
"delegates": [
{
"type": "flannel",
"name": "flannel.1",
"delegate": {
"isDefaultGateway": true
}
}
],
"kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig"
}

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvlan-conf
spec:
config: '{
"cniVersion": "0.3.1",
"plugins": [ {
"type": "macvlan",
"master": "eth1",
"mode": "bridge",
"ipam": {}
} ]
}'

apiVersion: v1
kind: Pod
metadata:
name: samplepod
annotations:
k8s.v1.cni.cncf.io/networks: '[
{ "name": "macvlan-conf"}
]'

spec:
containers:

  • name: samplepod
    command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
    image: dougbtv/centos-network

Name: samplepod
Namespace: default
Priority: 0
Node: localhost.localdomain/10.255.0.246
Start Time: Sat, 29 Aug 2020 05:15:39 -0400
Labels:
Annotations: k8s.v1.cni.cncf.io/network-status:
[{
"name": "",
"ips": [
"10.42.0.10"
],
"default": true,
"dns": {}
},{
"name": "default/macvlan-conf",
"interface": "net1",
"mac": "4e:e5:1e:6b:f6:1a",
"dns": {}
}]
k8s.v1.cni.cncf.io/networks: [ { "name": "macvlan-conf"} ]
k8s.v1.cni.cncf.io/networks-status:
[{
"name": "",
"ips": [
"10.42.0.10"
],
"default": true,
"dns": {}
},{
"name": "default/macvlan-conf",
"interface": "net1",
"mac": "4e:e5:1e:6b:f6:1a",
"dns": {}
}]
Status: Pending
IP:
IPs:
Containers:
samplepod:
Container ID:
Image: dougbtv/centos-network
Image ID:
Port:
Host Port:
Command:
/bin/bash
-c
trap : TERM INT; sleep infinity & wait
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Environment:
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-w9zhv (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-w9zhv:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-w9zhv
Optional: false
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s

@VictorRobellini
Copy link

I've been battling this as well and I just got it to work. Your distro may use different paths, but make sure /opt/cni/bin is where your plugins are located.

I installed a single node k3s cluster using the following command:
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--flannel-backend=none" sh -

Then I installed Flannel:
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

Your /etc/cni/net.d/ should have "10-flannel.conflist" listed

I followed the quick start instructions utilizing the daemonset. After updating the mater interface and deploying the sample pod, everything worked.

@sardella
Copy link
Author

that did the trick, Thanks

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

2 participants