siderolabs / talos

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

VMware: Use network information from guestinfo.metadata #6708

Closed ErikLundJensen closed 1 year ago

ErikLundJensen commented 1 year ago

Feature Request

Given a setup containing Cluster API with VMware (CAPV) and Talos (CABPT / CACPPT ) and IPAM InCluster then IP addresses can be allocated of pool of IP addresses. The field addressesFromPools in VSphereMachineTemplate specify which pool to use.

CAPV generates the guestinfo.metadata with an IP address from the pool for each virtual machine, however, Talos does not read guestinfo.metadata.

The Talos implementation of integration with VMware platform should be like the nocloud implementation where guestinfo.metadata is used and injected into the virtual machine's network configuration.

Description

Here is a sample of guestinfo.metadata produced by CAPV:

instance-id: "vmware-test-controlplane-zhnhr"
local-hostname: "vmware-test-controlplane-zhnhr"
wait-on-network:
  ipv4: false
  ipv6: false
network:
  version: 2
  ethernets:
    id0:
      match:
        macaddress: "00:50:41:b3:71:44"
      set-name: "eth0"
      wakeonlan: true
      addresses:
      - "192.168.0.230/24"
      gateway4: "192.168.0.1"

The nocloud implementation of reading and using guestinfo.metadatacould be reused in the VMware platform. metadata.go

Why is this needed?

See detailed explaination here IPAM support proposal

ErikLundJensen commented 1 year ago

The vmware metadata which is setup by CAPV is defined here: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/pkg/util/constants.go

ErikLundJensen commented 1 year ago

Adding refernce to PR-6737