2

I am using multus-cni to create multiple interfaces in my pod. I have weave-net CNI configured so pods come up with cluster ip 10.32.x.x. Using the below network-attachment-definition , I am able to bring up multiple interfaces inside a pod with IP addresses 10.32.0.180-199 but these IP addresses are unreachable from other pods in the same cluster. If I do kubectl exec into another pod, and ping 10.32.0.180, I am not able to ping that IP.

Can anyone tell me what needs to be done so that the additional interfaces in the pod are reachable within the cluster?

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: macvlan-conf
spec:
  config: '{
      "cniVersion": "0.3.0",
      "type": "macvlan",
      "master": "{{ .Values.global.interfaceName }}",
      "mode": "bridge",
      "ipam": {
        "type": "host-local",
        "subnet": "10.32.0.0/16",
        "rangeStart": "10.32.0.180",
        "rangeEnd": "10.32.0.199",
        "routes": [
          { "dst": "0.0.0.0/0" }
        ],
        "gateway": "10.32.0.1"
      }
    }'


kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T21:04:45Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T20:56:12Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
ItsPete
  • 2,363
  • 3
  • 27
  • 35
santanu
  • 21
  • 2
  • Can you share your multus `service account`, `cluster role` and `pod` definition yaml files? – acid_fuji Dec 18 '19 at 10:58
  • I have a similar problem, where I try to create two networks - the default k8s one (I use flannel for that), and a secondary overlay network (I use weave for that). When I exec into pods, I see the two interfaces, but IPs are not reachable from the secondary network). – Anton Evangelatov Dec 30 '19 at 12:23

1 Answers1

-1

I used host-device which seems to be working perfectly

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: host-1
spec:
  config: '{
            "cniVersion": "0.3.1",
            "type": "host-device",
            "device": "enp0s8"
          }'

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Zamalkawy
  • 59
  • 1
  • 4