Skip to content

feat(vpc): cozyplane variant of the VPC application - #4508

Draft
Timofei Larkin (lllamnyp) wants to merge 3 commits into
feat/cozyplanefrom
feat/cozyplane-vpc-app
Draft

Timofei Larkin (lllamnyp) wants to merge 3 commits into
feat/cozyplanefrom
feat/cozyplane-vpc-app

Conversation

@lllamnyp

@lllamnyp Timofei Larkin (lllamnyp) commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

What this PR does

Stacked on #3149. The cozyplane networking variant skips the kube-ovn/multus-backed virtualprivatecloud application, which left the VirtualPrivateCloud catalog kind absent on cozyplane clusters. This PR adds an alternative flavor of the same catalog kind, backed by cozyplane's sdn.cozystack.io API, and wires it in as a second variant of the existing delivery:

  • packages/apps/vpc-cozyplane — a chart that creates a namespaced VPC (address ranges may overlap between VPCs; isolation is by overlay), the owner-namespace VPCBinding (attachment is default-deny even for the owner), one VPCPeering half per declared peer (bidirectional declaration, same UX as the kubevirt flavor's peers), and an optional VPCGateway (gateway.enabled / nat / ingressLoadBalancer / loadBalancerClass).
  • virtualprivatecloud-rd now selects which ApplicationDefinition it installs by a variant value: both flavors register the same kind with the same release prefix, but each definition must point at its own variant's ExternalArtifact. The cozyplane definition is generated by the same hack/update-crd.sh flow; the script now honors VARIANT/OUT from the environment instead of always reading variants[0] of the PackageSource.
  • cozystack.virtualprivatecloud-application gains a cozyplane variant whose ordering edge is cozystack.cozyplane-apiserver (the group is aggregated-only) instead of cozystack.multus, and the iaas bundle selects the flavor by bundles.system.networkingVariant, replacing the previous skip.

Covered by helm-unittest suites in all three places: chart rendering (binding always present, gateway/peering shapes, loadBalancerClass absent when empty), rd variant selection (exactly one definition, correct chartRef, unknown variant fails the render), and platform wiring (bundle flavor selection, dependency edges with no multus edge on cozyplane).

Not in scope, deliberately: cross-namespace VPCBindings (sharing a VPC with another tenant's namespace), reserved NAT identities (addressClaimName waits on the address substrate), and e2e — real-cluster validation of the whole cozyplane stack is tracked on #3149.

VM attachment (added 2026-10-08). vm-instance now joins a VM to a cozyplane VPC: when the cluster serves sdn.cozystack.io (API discovery, the same gate as the Kube-OVN IP pinning), the chart stamps sdn.cozystack.io/vpc: virtualprivatecloud-<networks[0].name> on the virt-launcher pod and renders no multus networks and no secondary interfaces — the VM keeps its single pod interface. The values contract is unchanged for consumers: networks: [{name: <VPC catalog name>}], the name without the virtualprivatecloud- prefix, same convention as peers[].vpcName; at most one entry (more fails the render by name, since a cozyplane pod joins exactly one VPC). The Cilium-variant multus path is untouched and both branches are unit-tested.

Still to verify on a live stand, not by rendering: which KubeVirt interface binding the default interface needs on cozyplane (the template uses bridge: {}; masquerade may be required), whether the guest acquires the VPC address over DHCP, and whether kubevirt.io/allow-pod-bridge-network-live-migration still applies — the CNI stamps sdn.cozystack.io/vpc-ip/-mac on the launcher pod to check against.

Screenshots

Not a UI change.

Downstream repositories

The trigger map fires for cozystack/website (a new package under packages/apps/ needs an entry in the website Makefile's app lists, and the variant recomposition touches the variants page) and arguably for terraform-provider-cozystack (the VirtualPrivateCloud spec differs per flavor, so the hand-maintained schema will not match cozyplane clusters). Both follow-ups are deferred while this stack is draft — filing them against an unmerged experimental variant would be noise; they should be opened when #3149 leaves draft. Boxes left unticked so a human decides.

Release note

feat(vpc): the cozyplane networking variant now serves the VirtualPrivateCloud application, backed by sdn.cozystack.io — namespaced VPCs with peering and an optional north-south gateway

@github-actions github-actions Bot added area/networking Issues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn) kind/feature Categorizes issue or PR as related to a new feature labels Sep 26, 2026
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions github-actions Bot added the size/XL This PR changes 500-999 lines, ignoring generated files label Sep 26, 2026
@lllamnyp
Timofei Larkin (lllamnyp) added this pull request to stack #4509 September 26, 2026 16:45
@lllamnyp
Timofei Larkin (lllamnyp) force-pushed the feat/cozyplane-vpc-app branch 2 times, most recently from 1c80c88 to 324c201 Compare October 2, 2026 16:53
The kubevirt flavor of virtualprivatecloud is kube-ovn/multus-backed,
so the cozyplane networking variant skipped it and the
VirtualPrivateCloud catalog kind was simply absent there. This adds an
alternative flavor serving the same kind from sdn.cozystack.io: the
chart creates a namespaced VPC, the owner-namespace VPCBinding
(attachment is default-deny even for the owner), one VPCPeering half
per declared peer, and an optional VPCGateway as the north-south
boundary.

Delivery follows the networking variant: the PackageSource gains a
cozyplane variant whose ordering edge is the aggregated sdn apiserver
instead of multus, the iaas bundle selects the flavor by
networkingVariant, and virtualprivatecloud-rd installs the matching
ApplicationDefinition. Each flavor's definition must point at its own
variant's ExternalArtifact, which is why hack/update-crd.sh now honors
VARIANT from the environment instead of always reading variants[0].

Assisted-by: LLM
Signed-off-by: Timofei Larkin <[email protected]>
Cozystack tenants are bound to the cozy:tenant* tiers, whose
aggregation selects only rbac.cozystack.io/aggregate-to-tenant-*
labels; cozyplane's chart-shipped tenant roles aggregate into the
built-in admin/edit/view ClusterRoles, which no tenant holds, so on
the cozyplane variant VPC self-service was Forbidden for every tenant.
Grant the namespaced sdn kinds in the tenant tiers, mirroring the
chart's own grant: the base role writes them (the tenant's Flux
impersonation applies the vpc app's objects, and its wildcard verbs
cover export and peer), the view tier reads them plus status, and the
admin tier writes them and carries export/peer on vpcs — the verbs
that gate VPCBinding and VPCPeering creation against the tenant's own
VPCs. Inert on the default variant, where the group serves only
securitygroups.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <[email protected]>
On the cozyplane networking variant there is no multus, so a VM that
listed a network rendered a multus attachment that can never resolve
and sat Pending forever. When the cluster serves sdn.cozystack.io —
detected by API discovery, the same way the Kube-OVN IP pinning is —
the chart now stamps sdn.cozystack.io/vpc:
virtualprivatecloud-<networks[0].name> on the virt-launcher pod (the
bare name resolves in the VM's own namespace) and renders no multus
networks and no secondary interfaces: the VM keeps its single pod
interface and the CNI gives it its VPC identity. A cozyplane pod joins
exactly one VPC, so more than one network entry fails the render by
name rather than attaching silently to the first. The Cilium-variant
multus path is unchanged, and the suite pins both branches.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking Issues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn) kind/feature Categorizes issue or PR as related to a new feature size/XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant