Issue with Allocating Ethernet Interface to Two Pods Using MacvlanNetwork CRD

Hi,

I’m encountering an issue when trying to allocate an Ethernet interface to two Pods using the MacvlanNetwork CRD.


Host Environment
Both servers have an eth1 interface and can ping each other successfully.


YAML for Creating MacvlanNetwork CRD

apiVersion: mellanox.com/v1alpha1
kind: MacvlanNetwork
metadata:
  name: macvlan-eth1
spec:
  networkNamespace: jsh
  master: eth1
  mode: bridge
  mtu: 1500
  ipam: |
    {
      "type": "whereabouts",
      "datastore": "kubernetes",
      "kubernetes": {
        "kubeconfig": "/etc/cni/net.d/whereabouts.d/whereabouts.kubeconfig"
      },
      "log_file" : "/var/log/whereabouts.log",
      "log_level" : "info",
      "range": "192.168.10.128/26"
    }

YAML for Creating Pod

apiVersion: v1
kind: Pod
metadata:
  name: test-pod-7
  namespace: jsh
  annotations:
    k8s.v1.cni.cncf.io/networks: |
      [
        { "name": "macvlan-eth1",  "interface": "eth1" }
      ]
spec:
  containers:
  - name: app
    ...
    securityContext:
      capabilities:
        add: [ "IPC_LOCK" ]

Inside the Pod
Verified the assigned interface and performed ping tests using kubectl exec.


Despite these configurations, the two Pods cannot ping each other.
The interfaces seem to be correctly assigned, but communication between the Pods is not working.


Could anyone provide guidance on how to resolve this issue?
Any help would be greatly appreciated!
Thank you in advance.

My cluster is using Flannel to connect the network between pods.
However, it seems that this Flannel is using eth1 among the host network interfaces.
Could this be the cause…?

Hi ,

Yes , you should check first the Flannel configuration and firewall .

Thanks
Samer

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.