siderolabs / talos

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

Segment Support #8365

Open smira opened 8 months ago

smira commented 8 months ago

Each Talos machine should know which segment it is part of, and also should know a segment of each other Talos machine in the cluster.

Segments might be very useful for other features (not only KubeSpan), so even though we scope segments to be part of this feature, they should be made generic enough to be useful outside of KubeSpan.

Machine configuration can be used to assign a machine to the segment based on either some static property, or using some matchers. For KubeSpan case, the most useful match might be on the machine address (segment is a subnet).

kind: SegmentConfig
segments:
  - address:  # match by node's address
      us-east-1:
         - 10.13.0.0/16
      us-east-2:
         - 10.14.0.0/16
  - platform: {} # use platform's data to get region information (if available)
  - static: us-east-1 # static onfiguration

In the end each Talos machine should know its segment, and publish this information to the discovery service, so that all other machines know segment assignment in the cluster.

Any machines without a segment assignment should be treated as if they are part of its own segment (for the KubeSpan operations).

sanmai-NL commented 7 months ago

I feel this is useful and a gap, but can you motivate a bit the actual value this information has for Talos Linux? Am I correct in that you essentially want to reflect routing tables?