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

Expose bond interface ip as external IP to kubernetes service #497

Open
sainath40 opened this issue Aug 14, 2023 · 0 comments
Open

Expose bond interface ip as external IP to kubernetes service #497

sainath40 opened this issue Aug 14, 2023 · 0 comments

Comments

@sainath40
Copy link

sainath40 commented Aug 14, 2023

I am trying to expose bond interface ip as external IP to a kubernetes service.

I have a Pod in default namespace that is attached with 8 SRIOV VFs. These VFs in the Pod are aggregated as a bond interface (bond0). I am able to reach to bond interface from the physical ports. But the traffic is not being routed from bond interface to kubernetes service endpoint.

Is it possible to achieve such usecase ?

Below are the configurations that i use.

http-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: http-service
  labels:
    app.kubernetes.io/name: http-server
spec:
  externalIPs:
  - 10.21.52.224  # Replace with your desired external IP address
  selector:
    app.kubernetes.io/name: http-server
  ports:
  - protocol: TCP
    port: 8010
    targetPort: 443

bond-cni.yaml NAD:

[root@appliance-1 ~]# cat conf_file/bond.yaml 
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: bond-net
spec:
  config: '{
  "type": "bond",
  "cniVersion": "0.3.1",
  "name": "bond-net",
  "ifname": "bond0",
  "mode": "802.3ad",
  "linksInContainer": true,
  "miimon": "100",
  "links": [
     {"name": "net0"},
     {"name": "net1"},
     {"name": "net2"},
     {"name": "net3"},
     {"name": "net4"},
     {"name": "net5"},
     {"name": "net6"},
     {"name": "net7"}
  ],

SRIOV VF 0 NAD yaml: ( in the same way, 1-7 NADs are created)

apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  annotations:
    k8s.v1.cni.cncf.io/resourceName: intel.com/intel_sriov_hadevice0
  generation: 1
  name: sriov-ha0-vm1
  namespace: default
spec:
  config: '{ "cniVersion": "0.3.1", "type": "sriov", "mac": "<mac>", "vlan": 2152, "spoofChk":
    "off", "trust": "on" }'

Pod_spec.yaml:

apiVersion: v1
kind: Pod
metadata:
  name: ha-agent
  labels:
    app.kubernetes.io/name: ha-agent
  annotations:
    k8s.v1.cni.cncf.io/networks: '[
      {"name": "sriov-ha0-vm1", "interface": "net0" },
      {"name": "sriov-ha1-vm1", "interface": "net1" },
      {"name": "sriov-ha2-vm1", "interface": "net2" },
      {"name": "sriov-ha3-vm1", "interface": "net3" },
      {"name": "sriov-ha4-vm1", "interface": "net4" },
      {"name": "sriov-ha5-vm1", "interface": "net5" },
      {"name": "sriov-ha6-vm1", "interface": "net6" },
      {"name": "sriov-ha7-vm1", "interface": "net7" },
      {"name": "bond-net", "interface": "bond0" }
    ]'
<truncated>
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