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

internet connectivity for additional interface added via multus #1380

Open
Rammurthy5 opened this issue Jan 24, 2025 · 2 comments
Open

internet connectivity for additional interface added via multus #1380

Rammurthy5 opened this issue Jan 24, 2025 · 2 comments

Comments

@Rammurthy5
Copy link

Hiya, i have got eth0 and net1 added to my pod. internet connectivity for eth0 is fine and i would like the same for net1. how do we achieve that please? here is my config for macvlan and pod below.

macvlan NAD

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: macvlan-conf
spec:
  config: '{
      "cniVersion": "0.3.0",
      "type": "macvlan",
      "master": "eth0",
      "mode": "bridge",
      "ipam": {
        "type": "host-local",
        "subnet": "192.168.1.0/24",
        "rangeStart": "192.168.1.200",
        "rangeEnd": "192.168.1.216",
        "routes": [
          { "dst": "0.0.0.0/0" }
        ],
        "gateway": "192.168.1.1"
      }
    }'

samplepod.yaml

piVersion: v1
kind: Pod
metadata:
  name: samplepod
  annotations:
    k8s.v1.cni.cncf.io/networks: '[
              {
                 "name" : "macvlan-conf",
                 "default-route": ["192.168.1.1"]
              }
        ]'
spec:
  containers:
  - name: samplepod
    command: ["/bin/ash", "-c", "trap : TERM INT; sleep infinity & wait"]
    image: alpine
@dougbtv
Copy link
Member

dougbtv commented Feb 13, 2025

Maybe try bridge CNI instead?

Try this -- create a bridge on your system and make sure that bridge has connectivity. Then, use the name of that bridge in the bridge CNI configuration.

@Rammurthy5
Copy link
Author

Rammurthy5 commented Feb 14, 2025

I thought i created bridge already. this is on talos k8s cluster.
this is how i patched the machineconfig

machine:
    network:
      interfaces:
      - interface: br0
        addresses:
          - 172.16.1.60/24
        bridge:
          stp:
            enabled: true
          interfaces:
              - net1
        routes:
            - network: 0.0.0.0/0 # The route's network (destination).
              gateway: 172.16.1.254 # The route's gateway (if empty, creates link scope route).
              metric: 1024 # The optional metric for the route.

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