Repository navigation
feat(vpc): cozyplane variant of the VPC application - #4508
Draft
Timofei Larkin (lllamnyp) wants to merge 3 commits into
Draft
Timofei Larkin (lllamnyp) wants to merge 3 commits into
Timofei Larkin (lllamnyp) wants to merge 3 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
Timofei Larkin (lllamnyp)
added this pull request to stack #4509
September 26, 2026 16:45
Timofei Larkin (lllamnyp)
force-pushed
the
feat/cozyplane-vpc-app
branch
from
September 28, 2026 10:32
fde0966 to
0d37229
Compare
Timofei Larkin (lllamnyp)
force-pushed
the
feat/cozyplane-vpc-app
branch
from
September 29, 2026 12:26
0d37229 to
d2410eb
Compare
Timofei Larkin (lllamnyp)
force-pushed
the
feat/cozyplane-vpc-app
branch
from
September 30, 2026 09:20
d2410eb to
6253c62
Compare
12 tasks
Timofei Larkin (lllamnyp)
force-pushed
the
feat/cozyplane-vpc-app
branch
2 times, most recently
from
October 2, 2026 16:53
1c80c88 to
324c201
Compare
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]>
Timofei Larkin (lllamnyp)
force-pushed
the
feat/cozyplane-vpc-app
branch
from
October 7, 2026 12:46
324c201 to
c754a6d
Compare
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Stacked on #3149. The cozyplane networking variant skips the kube-ovn/multus-backed
virtualprivatecloudapplication, which left the VirtualPrivateCloud catalog kind absent on cozyplane clusters. This PR adds an alternative flavor of the same catalog kind, backed by cozyplane'ssdn.cozystack.ioAPI, and wires it in as a second variant of the existing delivery:packages/apps/vpc-cozyplane— a chart that creates a namespacedVPC(address ranges may overlap between VPCs; isolation is by overlay), the owner-namespaceVPCBinding(attachment is default-deny even for the owner), oneVPCPeeringhalf per declared peer (bidirectional declaration, same UX as the kubevirt flavor'speers), and an optionalVPCGateway(gateway.enabled/nat/ingressLoadBalancer/loadBalancerClass).virtualprivatecloud-rdnow selects which ApplicationDefinition it installs by avariantvalue: 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 samehack/update-crd.shflow; the script now honorsVARIANT/OUTfrom the environment instead of always readingvariants[0]of the PackageSource.cozystack.virtualprivatecloud-applicationgains acozyplanevariant whose ordering edge iscozystack.cozyplane-apiserver(the group is aggregated-only) instead ofcozystack.multus, and the iaas bundle selects the flavor bybundles.system.networkingVariant, replacing the previous skip.Covered by helm-unittest suites in all three places: chart rendering (binding always present, gateway/peering shapes,
loadBalancerClassabsent 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 (
addressClaimNamewaits 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-instancenow joins a VM to a cozyplane VPC: when the cluster servessdn.cozystack.io(API discovery, the same gate as the Kube-OVN IP pinning), the chart stampssdn.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 thevirtualprivatecloud-prefix, same convention aspeers[].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 whetherkubevirt.io/allow-pod-bridge-network-live-migrationstill applies — the CNI stampssdn.cozystack.io/vpc-ip/-macon 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