Skip to content

feat: add veth pair support#13816

Open
frezbo wants to merge 1 commit into
siderolabs:mainfrom
frezbo:letta/veth-config-342ca17b
Open

feat: add veth pair support#13816
frezbo wants to merge 1 commit into
siderolabs:mainfrom
frezbo:letta/veth-config-342ca17b

Conversation

@frezbo

@frezbo frezbo commented Jul 21, 2026

Copy link
Copy Markdown
Member

Add a new VethConfig machine config document to support veth pairs.

Fixes: #12859

Copilot AI review requested due to automatic review settings July 21, 2026 14:52
@github-project-automation github-project-automation Bot moved this to To Do in Planning Jul 21, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Jul 21, 2026
@frezbo
frezbo force-pushed the letta/veth-config-342ca17b branch from 96f0370 to b0d1a3b Compare July 21, 2026 14:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for declaratively managing Linux veth pairs via a new VethConfig machine config document, wiring it through config parsing, schema/doc generation, runtime resources, and network controllers.

Changes:

  • Introduces VethConfig machine config type (with validation), schema/doc output, and release notes.
  • Adds VethPairSpec/VethPairState resources and controllers to create/track veth pairs and project per-endpoint LinkSpecs.
  • Updates link/config controllers and integration tests to incorporate veth pair lifecycle, rename, VRF composition, and cleanup.

Reviewed changes

Copilot reviewed 38 out of 42 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/content/v1.14/schemas/config.schema.json Publishes VethConfig/VethPeerConfig into the v1.14 website schema bundle.
website/content/v1.14/reference/configuration/network/vethconfig.md Adds generated documentation page for VethConfig.
website/content/v1.14/reference/api.md Extends API reference to include veth-related resource specs.
pkg/machinery/resources/network/veth_pair_state.go Adds VethPairState typed resource definition and dynamic protobuf registration.
pkg/machinery/resources/network/veth_pair_spec.go Adds VethPairSpec typed resource definition, endpoint spec type, and canonical ID helpers.
pkg/machinery/resources/network/veth_pair_spec_test.go Unit tests for veth pair canonicalization, IDs, and state resource basics.
pkg/machinery/resources/network/network.go Adds LinkKindVeth constant.
pkg/machinery/resources/network/link_spec.go Extends LinkSpecSpec with a Veth field and merge handling.
pkg/machinery/resources/network/link_spec_test.go Updates YAML marshal test to include veth block.
pkg/machinery/resources/network/deep_copy.generated.go Regenerates deep-copy implementations for new veth-related spec structs.
pkg/machinery/resources/network/address_spec.go Updates deep-copy generator invocation to include veth-related types.
pkg/machinery/config/types/network/veth.go Implements VethConfigV1Alpha1 config document, validation, and peer endpoint wrapper.
pkg/machinery/config/types/network/veth_test.go Adds marshal/unmarshal stability and validation tests for VethConfig.
pkg/machinery/config/types/network/testdata/vethconfig.yaml Adds expected YAML fixture for VethConfig encoding tests.
pkg/machinery/config/types/network/network.go Adds veth.go to docgen and deep-copy generation inputs.
pkg/machinery/config/types/network/network_doc.go Adds generated doc metadata for VethConfig and VethPeerConfig.
pkg/machinery/config/types/network/link.go Adds VethKind to conflicting link kinds list.
pkg/machinery/config/types/network/deep_copy.generated.go Regenerates deep-copy for config types including VethConfigV1Alpha1.
pkg/machinery/config/schemas/config.schema.json Publishes VethConfig/VethPeerConfig into the machinery schema bundle.
pkg/machinery/config/container/container.go Adds veth-aware link-name conflict detection and exposes veth configs + peer as link configs.
pkg/machinery/config/container/container_test.go Tests veth link config enumeration and conflict behavior.
pkg/machinery/config/config/network.go Introduces NetworkVethConfig/NetworkVethLinkConfig interfaces.
pkg/machinery/config/config/config.go Adds NetworkVethConfigs() to the main config interface.
pkg/machinery/api/resource/definitions/network/network.pb.go Regenerates protobuf Go bindings for new veth-related messages/fields.
pkg/machinery/api/resource/definitions/network/network_vtproto.pb.go Regenerates vtproto fast-path bindings for new veth-related messages/fields.
internal/integration/api/network-config.go Adds integration test covering veth create/rename, VRF composition, and cleanup.
internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_state.go Registers VethPairSpec and VethPairState resources in runtime state.
internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_controller.go Wires new veth controllers into the runtime controller set.
internal/app/machined/pkg/controllers/network/veth_pair_spec.go Adds controller projecting VethPairSpec into endpoint LinkSpecs.
internal/app/machined/pkg/controllers/network/veth_pair_spec_test.go Adds controller-level tests for veth pair lifecycle and edge cases.
internal/app/machined/pkg/controllers/network/veth_integration_test.go Adds end-to-end tests for veth pair lifecycle driven by machine config.
internal/app/machined/pkg/controllers/network/veth_config.go Adds controller rendering VethConfig into VethPairSpec.
internal/app/machined/pkg/controllers/network/veth_config_test.go Tests projection from machine config to VethPairSpec and literal endpoint naming.
internal/app/machined/pkg/controllers/network/link_spec.go Extends link reconciliation to create/cleanup veth pairs and track VethPairState.
internal/app/machined/pkg/controllers/network/link_spec_test.go Adds tests for veth handling in LinkSpecController.
internal/app/machined/pkg/controllers/network/link_config.go Skips veth endpoints in LinkConfig processing (veth endpoints are literal / handled elsewhere).
internal/app/machined/pkg/controllers/network/link_config_test.go Adds VRF + veth new-style machine configuration test coverage.
internal/app/machined/pkg/controllers/network/address_config_test.go Adds address config projection coverage for veth endpoints.
internal/app/machined/pkg/adapters/network/veth_pair_spec.go Adds rtnetlink attribute encoding helper for veth peer creation.
internal/app/machined/pkg/adapters/network/veth_pair_spec_test.go Unit tests for veth rtnetlink attribute encoding.
hack/release.toml Adds release notes entry documenting the new VethConfig feature.
api/resource/definitions/network/network.proto Adds protobuf message definitions/fields for veth-related specs.
Files not reviewed (4)
  • pkg/machinery/api/resource/definitions/network/network.pb.go: Generated file
  • pkg/machinery/api/resource/definitions/network/network_vtproto.pb.go: Generated file
  • pkg/machinery/config/types/network/deep_copy.generated.go: Generated file
  • pkg/machinery/config/types/network/network_doc.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/app/machined/pkg/controllers/network/veth_pair_spec.go
Comment thread internal/app/machined/pkg/controllers/network/veth_config.go
Comment thread internal/app/machined/pkg/controllers/network/link_spec.go Outdated
Add a new `VethConfig` machine config document to support veth pairs.

Fixes: siderolabs#12859

Signed-off-by: Noel Georgi <git@frezbo.dev>
@frezbo
frezbo force-pushed the letta/veth-config-342ca17b branch from b0d1a3b to ac1f2f0 Compare July 21, 2026 16:03
return multiErr.ErrorOrNil()
}

func (ctrl *LinkSpecController) cleanupVethPairStates(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's crazy that this code is here... I don't think this controller should ever produce any state

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change here seems to be too complicated compared to what it should be imho

I don't see why veth is so much special - it's basically two LinkSpecs. what is there that needs to be handled very different?

The status of veth pairs should be/can be observed via LinkStatus, as this would cover links which were not created by Talos

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could create VethPairStatus out of LinkStatus if we want to

}
}

if linkConfig, ok := d.(config.NetworkCommonLinkConfig); ok {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too specific for a single type, instead we should in the common block handle the fact that Veth basically has two names - one for itself and another for the peer

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that's easier

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could test for a specific small interface for the document to claim another name I think

//
//gotagsrewrite:gen
type VethSpec struct {
PeerName string `yaml:"peerName,omitempty" protobuf:"1"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link_status should have a matching change

const VethPairStateType = resource.Type("VethPairStates.net.talos.dev")

// VethPairState records a veth pair managed by LinkSpecController.
type VethPairState = typed.Resource[VethPairStateSpec, VethPairStateExtension]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type VethPairState = typed.Resource[VethPairStateSpec, VethPairStateExtension]
type VethPairStatus = typed.Resource[VethPairStateSpec, VethPairStateExtension]

we use Status everywhere

Not sure what is the ID of the resource? Do we create to resources per pair?

frezbo added a commit to frezbo/talos that referenced this pull request Jul 21, 2026
Add `CRICustomizationConfig` and `CRIBaseRuntimeSpecConfig` documents
with automatic CRI regeneration and restart. Deprecate `machine.files` and
`machine.baseRuntimeSpecOverrides` while preserving legacy compatibility.

Fixes: siderolabs#13816

Signed-off-by: Noel Georgi <git@frezbo.dev>
frezbo added a commit to frezbo/talos that referenced this pull request Jul 21, 2026
Add `CRICustomizationConfig` and `CRIBaseRuntimeSpecConfig` documents
with automatic CRI regeneration and restart. Deprecate `machine.files` and
`machine.baseRuntimeSpecOverrides` while preserving legacy compatibility.

Fixes: siderolabs#13816

Signed-off-by: Noel Georgi <git@frezbo.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Feature Request: support defining veth inerface pairs in machine config

4 participants