siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.
https://www.talos.dev
Mozilla Public License 2.0
6.89k stars 555 forks source link

nocloud network support vlans and bonds #9753

Open TimJones opened 2 days ago

TimJones commented 2 days ago

Feature Request

nocloud Talos should add support for vlans and bonds for v1 metadata, and vlans for v2 metadata.

Description

In the nocloud platform code we don't parse the bond or vlan type for version: 1: https://github.com/siderolabs/talos/blob/main/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/metadata.go#L300

And vlans aren't parsed for version: 2 metadata: https://github.com/siderolabs/talos/blob/main/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/metadata.go#L598

rsmitty commented 2 days ago

Some more color, we ran into this trying to just use the v1 network block in PNAP, but they have VLAN and bond configs in there. Here's what it looks like:

version: 1
config:

- type: physical
  name: eno1np0
  mac_address: "3c:ec:ef:e0:45:28"
  mtu: 9000

- type: physical
  name: eno2np1
  mac_address: "3c:ec:ef:e0:45:29"
  mtu: 9000

- type: bond
  name: bond0
  mac_address: "3c:ec:ef:e0:45:28"
  mtu: 9000
  bond_interfaces:
  - eno1np0
  - eno2np1
  params:
    bond-lacp-rate: fast
    bond-miimon: 100
    bond-mode: 802.3ad
    bond-xmit-hash-policy: layer3+4
    up-delay: 0
    down-delay: 0

# public frontend MERGED_FRONTEND vlan 2
- type: vlan
  name: bond0.2
  mtu: 9000
  vlan_id: 2
  vlan_link: bond0
  subnets:
  - address: xxx/29
    gateway: xxx
    type: static

# private backend vlan 4
- type: vlan
  mtu: 9000
  name: bond0.4
  vlan_id: 4
  vlan_link: bond0
  subnets:
  - type: static
    address: 10.0.0.11/24

- type: nameserver
  address:
  - 8.8.8.8
  - 8.8.4.4

This isn't super urgent, but I'm envisioning a PNAP integration and to pull that off, we could just make use of this existing network block, set it up and not have any real reason to build a platform for them. They could just boot nocloud and profit.