Skip to content

Add Network, NetworkLink, InterNetworkIngress, NetworkAccess CRD types and manifests - #2541

Open
fgiorgetti wants to merge 9 commits into
skupperproject:mainfrom
fgiorgetti:multi-van-pr1-api-types
Open

Add Network, NetworkLink, InterNetworkIngress, NetworkAccess CRD types and manifests#2541
fgiorgetti wants to merge 9 commits into
skupperproject:mainfrom
fgiorgetti:multi-van-pr1-api-types

Conversation

@fgiorgetti

@fgiorgetti fgiorgetti commented Jul 22, 2026

Copy link
Copy Markdown
Member

This is the initial PR (split from multi-van effort) that just introduces the new CRDs and a small addition to RouterAccessStatus. Here are the new custom resource types:

  • Network: identifies a Skupper network by its NetworkId
  • NetworkLink: establishes a link to another network via TLS hostname/port
  • InterNetworkIngress: routes traffic from a NetworkLink or NetworkAccess to a local routing key
  • NetworkAccess: exposes a local endpoint to another network with optional dynamic port allocation and TLS

Also adds:

  • CRD YAML manifests for all four new types under config/crd/bases/
  • Generated client, informer, and lister code for all four new types
  • Updates config/crd/kustomization.yaml to reference the new manifests
  • Updates pkg/apis/skupper/v2alpha1/register.go to register the new types
  • Updates zz_generated.deepcopy.go with DeepCopy methods for new types
  • RouterAccess no longer requires a port assigned to a role (dynamic port allocation)

Summary by CodeRabbit

  • New Features
    • Added new Kubernetes custom resources: Network, NetworkLink, NetworkAccess, and InterNetworkIngress, with validated spec/status schemas and improved kubectl columns.
    • Tightened InterNetworkIngress input validation to require networkLink and/or networkAccess.
  • Bug Fixes
    • Enhanced RouterAccess by exposing allocated ports via status.roles, improving role port/endpoint tracking.
  • Documentation
    • Updated CRD status condition descriptions and added an ADR for multi-VAN network resources.
  • Tests
    • Added extensive unit tests for the new and updated behaviors.

…s and manifests

Introduces four new Skupper v2alpha1 API types to enable inter-network
connectivity:

- Network: identifies a Skupper network by its NetworkId
- NetworkLink: establishes a link to another network via TLS hostname/port
- InterNetworkIngress: routes traffic from a NetworkLink or NetworkAccess
  to a local routing key
- NetworkAccess: exposes a local endpoint to another network with optional
  dynamic port allocation and TLS

Also adds:
- CRD YAML manifests for all four new types under config/crd/bases/
- Generated client, informer, and lister code for all four new types
- Updates config/crd/kustomization.yaml to reference the new manifests
- Updates pkg/apis/skupper/v2alpha1/register.go to register the new types
- Updates zz_generated.deepcopy.go with DeepCopy methods for new types
@fgiorgetti
fgiorgetti requested review from ajssmith and c-kruse and removed request for c-kruse, nluaces and pwright July 22, 2026 19:25
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds v2alpha1 API types and helpers for network resources, registers and deep-copies them, and introduces corresponding Kubernetes CRDs with validation, status subresources, printer columns, Kustomize inclusion, tests, and an ADR describing multi-VAN resource management.

Changes

Network API and CRDs

Layer / File(s) Summary
Network API contracts and helpers
pkg/apis/skupper/v2alpha1/types.go
Adds network resource types, status helpers, endpoint reconciliation, port allocation, InterNetworkIngress validation, and RouterAccess role tracking.
API behavior validation
pkg/apis/skupper/v2alpha1/types_test.go
Tests RouterAccess port and condition behavior plus network resource configuration, endpoint, readiness, and allocation behavior.
Runtime registration and deepcopy support
pkg/apis/skupper/v2alpha1/register.go, pkg/apis/skupper/v2alpha1/zz_generated.deepcopy.go
Registers the new API resources and adds deepcopy implementations for resources, lists, specs, statuses, and RouterAccess roles.
CRD schemas and resource bundle
config/crd/bases/skupper_*network*_crd.yaml, config/crd/bases/skupper_inter_network_ingress_crd.yaml, config/crd/bases/skupper_router_access_crd.yaml, config/crd/kustomization.yaml, doc/adr/0011-multi-van-resources.md
Adds validated network CRDs, extends RouterAccess status with roles, includes the CRDs in the Kustomize resource list, and documents the multi-VAN resource design.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: c-kruse, nluaces, pwright

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding four new CRD types and their manifests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3a1b68e5-7543-4569-8c83-cb7a82adf8e6

📥 Commits

Reviewing files that changed from the base of the PR and between e1fde23 and b545f7d.

⛔ Files ignored due to path filters (22)
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_network.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_networklink.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_skupper_client.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/generated_expansion.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/network.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/networklink.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/skupper_client.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/generic.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/interface.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/network.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/networklink.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/expansion_generated.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/network.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/networklink.go is excluded by !**/generated/**
📒 Files selected for processing (9)
  • config/crd/bases/skupper_inter_network_ingress_crd.yaml
  • config/crd/bases/skupper_network_access_crd.yaml
  • config/crd/bases/skupper_network_crd.yaml
  • config/crd/bases/skupper_network_link_crd.yaml
  • config/crd/bases/skupper_router_access_crd.yaml
  • config/crd/kustomization.yaml
  • pkg/apis/skupper/v2alpha1/register.go
  • pkg/apis/skupper/v2alpha1/types.go
  • pkg/apis/skupper/v2alpha1/zz_generated.deepcopy.go

Comment thread config/crd/bases/skupper_inter_network_ingress_crd.yaml Outdated
Comment thread config/crd/bases/skupper_network_crd.yaml Outdated
Comment thread config/crd/bases/skupper_network_link_crd.yaml Outdated
Comment thread pkg/apis/skupper/v2alpha1/types.go
@fgiorgetti
fgiorgetti force-pushed the multi-van-pr1-api-types branch from b545f7d to 2b809a8 Compare July 28, 2026 16:45

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
pkg/apis/skupper/v2alpha1/types.go (1)

1381-1415: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated endpoint reconciliation logic.

This is an exact copy of RouterAccessStatus.UpdateEndpointsForGroup (Lines 926-959). Extract a shared helper, e.g. func updateEndpointsForGroup(existing []Endpoint, desired []Endpoint, group string) ([]Endpoint, bool), and have both status types delegate to it, so future fixes don't have to be applied twice.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dacf0106-37d6-4fb2-8c86-f1bd57e9a0a1

📥 Commits

Reviewing files that changed from the base of the PR and between b545f7d and 2b809a8.

⛔ Files ignored due to path filters (22)
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_network.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_networklink.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/fake/fake_skupper_client.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/generated_expansion.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/network.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/networklink.go is excluded by !**/generated/**
  • pkg/generated/client/clientset/versioned/typed/skupper/v2alpha1/skupper_client.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/generic.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/interface.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/network.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/informers/externalversions/skupper/v2alpha1/networklink.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/expansion_generated.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/internetworkingress.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/network.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/networkaccess.go is excluded by !**/generated/**
  • pkg/generated/client/listers/skupper/v2alpha1/networklink.go is excluded by !**/generated/**
📒 Files selected for processing (9)
  • config/crd/bases/skupper_inter_network_ingress_crd.yaml
  • config/crd/bases/skupper_network_access_crd.yaml
  • config/crd/bases/skupper_network_crd.yaml
  • config/crd/bases/skupper_network_link_crd.yaml
  • config/crd/bases/skupper_router_access_crd.yaml
  • config/crd/kustomization.yaml
  • pkg/apis/skupper/v2alpha1/register.go
  • pkg/apis/skupper/v2alpha1/types.go
  • pkg/apis/skupper/v2alpha1/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (6)
  • config/crd/bases/skupper_network_access_crd.yaml
  • config/crd/bases/skupper_network_crd.yaml
  • config/crd/bases/skupper_network_link_crd.yaml
  • config/crd/bases/skupper_inter_network_ingress_crd.yaml
  • pkg/apis/skupper/v2alpha1/register.go
  • pkg/apis/skupper/v2alpha1/zz_generated.deepcopy.go

Comment thread pkg/apis/skupper/v2alpha1/types.go
Comment thread pkg/apis/skupper/v2alpha1/types.go
Comment thread config/crd/kustomization.yaml Outdated
- bases/skupper_multikeylistener_crd.yaml
- bases/skupper_network_crd.yaml
- bases/skupper_network_link_crd.yaml
- bases/skupper_network_access_crd.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Waiting to see your ADR, I'm sure you'll have considered this. I had imagined we'd have the net-new resources not installed by default - enabled/installed in some alternate controller configuration so that "experimental" features require opt in until we feel ready to commit to them.

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.

The current implementation (which should come next, once we settle the CRD discussion) does not yet handle the new CRDs as optionals, but I agree with you, that they must be considered optionals.
Along with the new ones, there is also a change to RouterAccess (which should not affect exisintg installations). But that is a great point.

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.

@c-kruse I have added a new chart skupper-crds, which installs only the default crds unless you specify --set multiVan=true. The Makefile target generate-crd-manifest now generates a new yaml called: skupper-multi-van-crds.yaml.
Let me know if you agree with this updated mechanism.

@fgiorgetti
fgiorgetti requested a review from c-kruse July 28, 2026 20:32

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ec058e68-c7fc-4327-a07a-bf8283c29c89

📥 Commits

Reviewing files that changed from the base of the PR and between 2b809a8 and 7ed9545.

📒 Files selected for processing (1)
  • doc/adr/0011-multi-van-resources.md

Comment thread doc/adr/0011-multi-van-resources.md

## Context

New CRDs have been added to support multi-van management through VMS.

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 should review the decision to add new CRDs versus extending the existing ones for multi-van support.

I recall that RBAC for the resources was a consideration but we should revisit.

Were there other factors to support adding new CRDs?

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'm thinking that depending on the type of modification of the CRD, it could provoke an incompatibility with existent custom resources that were created with old CRDs (ie fields reconsidered as required). Adding a new CRD instead of modifying the current ones gives more capacity for change without having deal with the migration of older CRs.

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.

@ajssmith NetworkAccess could be accommodated as part of RouterAccess, as RouterAccess is going to be used for "normal" roles as part of the multi-van work. The main reason why it is defined as a separate resource now, is RBAC.

For NetworkLinks, thought, I believe it should be kept separate from Links, because the purpose is different. While Links are used to form a VAN (let's say it as sites that will be able to access all available routing keys on the connected VAN), a NetworkLink has the purpose of connecting distinct VANs, whereas only specific routingKeys will be made available to the other.

Network should be its own IMO. The motivation for it is written as part of the Decision section.

InterNetworkIngress is also something that I see as a new Resource, as we could eventually have multiple of them to expose the same routingKey to different VANs.

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.

I'm thinking that depending on the type of modification of the CRD, it could provoke an incompatibility with existent custom resources that were created with old CRDs (ie fields reconsidered as required). Adding a new CRD instead of modifying the current ones gives more capacity for change without having deal with the migration of older CRs.

@nluaces this is also something to be careful about. Right now, the change we have here for RouterAccess, is not supposed to break existing resources as a new field was added as part of the Status field. But if we modify something to accommodate new needs, it is something we have to keep in mind.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
pkg/apis/skupper/v2alpha1/types_test.go (1)

132-152: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a regression test for ReleaseUnusedPorts(nil/[]).

This exact case (empty unusedPorts) previously caused Status.Roles to be wiped entirely — worth locking in explicitly so a future refactor can't reintroduce it.

t.Run("empty input keeps all roles", func(t *testing.T) {
    r := &RouterAccess{}
    r.AllocatePort("inter-router", 55671)
    r.ReleaseUnusedPorts(nil)
    assert.Equal(t, r.GetAllocatedPortForRole("inter-router"), int32(55671))
})

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bb4b8f3-6b2a-4cbd-a124-4ddfb66fc5f3

📥 Commits

Reviewing files that changed from the base of the PR and between 7ed9545 and 330be09.

📒 Files selected for processing (3)
  • config/crd/bases/skupper_inter_network_ingress_crd.yaml
  • pkg/apis/skupper/v2alpha1/types.go
  • pkg/apis/skupper/v2alpha1/types_test.go

Comment thread config/crd/bases/skupper_inter_network_ingress_crd.yaml Outdated
Comment thread pkg/apis/skupper/v2alpha1/types.go Outdated

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
config/crd/bases/skupper_network_link_crd.yaml (1)

29-31: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Constrain router ports at the CRD boundary.

These unbounded integer fields currently allow invalid values to be accepted by the API before control-plane validation. Constrain config/crd/bases/skupper_network_link_crd.yaml#L29-L31 and config/crd.bases/skupper_network_access_crd.yaml#L22-L24 to valid router endpoints, and constrain the status port at config/crd/bases/skupper_network_access_crd.yaml#L109-L112 to 1..65535 since allocated ports are non-zero.

♻️ Duplicate comments (1)
config/crd/bases/skupper_inter_network_ingress_crd.yaml (1)

44-44: ⚠️ Potential issue | 🔴 Critical

Still invalid CEL string literals.

Line 44 uses Unicode quotation marks instead of ASCII ", so the validation rule cannot be parsed. Fix this generated YAML and the matching marker in pkg/apis/skupper/v2alpha1/types.go, Line 1306, before regenerating the CRD. This repeats the previous review finding.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3612cfd4-98aa-4e0e-8e49-029a924442d9

📥 Commits

Reviewing files that changed from the base of the PR and between 330be09 and 2139175.

📒 Files selected for processing (4)
  • config/crd/bases/skupper_inter_network_ingress_crd.yaml
  • config/crd/bases/skupper_network_access_crd.yaml
  • config/crd/bases/skupper_network_crd.yaml
  • config/crd/bases/skupper_network_link_crd.yaml

@fgiorgetti
fgiorgetti requested a review from ajssmith July 30, 2026 22:07
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

Successfully merging this pull request may close these issues.

4 participants