Repository navigation
Commit b58fd7b
committed
feat(site-router): add routed site-to-site IPsec gateway app (Phase 1)
Adds `site-router`, a catalog app for routed (L3), source-IP-preserving
tenant site-to-site connectivity over an IKEv2 IPsec tunnel terminated
in a VyOS KubeVirt gateway VM.
The chart materializes the gateway: VM + boot DataVolume, tunnel Service
type LoadBalancer (UDP 500/4500, native loadBalancerClass), PSK and
RBAC-isolated api-key Secrets, first-boot cloud-init, WorkloadMonitor,
and two net-new Cilium policies (gateway egressDeny + gateway ingress).
`site-router-controller` mediates what the chart cannot express:
deny-set validation of the tunnel's remote networks, the kube-ovn
return-route annotation, gateway-port `port_security` relaxation gated
on the guest source filter, the live VyOS configuration push over the
management API, tunnel/BGP observability, and status. There is no new
tenant CRD — the `apps.cozystack.io/SiteRouter` app instance is the
whole contract.
A shared pure `internal/siterouter/denyset` validator backs both a
SiteRouter-scoped admission check in `pkg/registry/apps/application`
and the reconcile-time check, so a cluster-overlapping `remoteCIDR` is
rejected identically at apply time and reconcile time. The admission
runs fail-closed on create and on update.
NAT/DNAT (a future `site-gateway`) and HA/VRRP are out of scope for
Phase 1. The negative-security acceptance suite is authored but parked:
its live run needs the published appliance image.
Contents:
- app chart packages/apps/site-router (10 helm-unittest suites)
- site-router-controller: internal/controller/siterouter,
cmd/site-router-controller, packages/system/site-router-controller
- VyOS core library internal/vyos (client/parse/observation) and
routed render internal/vyos/render
- internal/siterouter/denyset + the admission check
- the appliance build package packages/system/vyos-router-image
- platform wiring: PackageSources for the application and the
controller, both emitted by the naas bundle behind
bundles.iaas.enabled (the gateway needs KubeVirt + CDI, which
isp-hosted does not have)
- docs: README, security-model, image-lifecycle, followups
The e2e suite is committed parked as chainsaw-test.yaml.disabled, the
way hack/e2e-chainsaw/backup/ is parked, because its appliance image is
not published yet. Parking it as a file rather than as a name filtered
out of hack/select-e2e.sh's output is deliberate: the selector decides
coverage from the same enumeration, so a name-based filter leaves the
graph walk still reaching the suite. site-router-application depends on
cozystack.kubevirt-cdi, which would give kubevirt-cdi — and
cozystack-basics, which reaches it — exactly one suite, stripped to an
empty selection that both e2e lanes read as "skip Chainsaw" before
posting the required "E2E Tests" status green (#3392). Parking the file
keeps the suite out of the selector's universe and out of
select-install.sh's round-trip validation at once, so those packages
keep escalating to the full run as they do on main, and un-parking is
renaming the file back.
The appliance boot reference is committed digest-less
(`…/vyos-router-disk:v0.0.0`). A first-party image that has never been
built has no digest to commit, and nothing in the PR lane can create
one: build-vyos ends at `git diff --binary HEAD > vyos.patch` and
uploads it, so the stamp reaches e2e through pr.patch and never reaches
git; only tags.yaml's post-merge `Prepare release` commits a digest.
site-router-controller ships :v0.0.0 the same way in this PR, and
securitygroup-controller sat at :v0.0.0 on main until a release build
stamped it. An all-zero placeholder is strictly worse than no digest —
it passes `required`, looks like a valid pin and resolves nowhere — so
hack/image-refs-no-placeholder.bats keeps rejecting that shape
untouched. While the ref is digest-less it is invisible to
hack/lib/image-refs.sh, so promote/retag/mirror skip the appliance;
tests/dv_test.yaml accepts either form and carries a TODO to re-tighten
after the first release build.
VYOS_BUILD_REF is pinned to e14a4895 (upstream `rolling` tip,
2026-08-11), whose kernel_version 6.18.44 is the only kernel the rolling
mirror serves; the ref this started from asked for 6.18.41, which is
gone, and live-build fails hard on that rather than building something
stale. VYOS_VERSION tracks the ref's commit date so the label stays a
function of the pin. The pin comment previously claimed Renovate kept
these from aging silently — both custom managers do match the file, but
Renovate only evaluates the default branch and neither the Makefile nor
the managers exist there until this merges, so the pins were unwatched
by construction; even after merge they raise a PR rather than holding
the build up, while the breakage is on the mirror's kernel-retention
clock. The comment and docs/image-lifecycle.md now say that.
Two shared checks move with the app: cozystack-api's ClusterRole gains
a name-scoped `get` on the cozystack ConfigMap that the deny-set
admission reads (its pinned rule count goes 16 -> 17), and the
site-router-controller chart ships the RBAC and deployment suites the
sibling controller packages ship.
Signed-off-by: Myasnikov Daniil <[email protected]>1 parent cc70cef commit b58fd7b
107 files changed
Lines changed: 15430 additions & 22 deletions
File tree
- .github
- workflows
- api/apps/v1alpha1/siterouter
- cmd/site-router-controller
- hack
- e2e-chainsaw/site-router
- internal
- controller/siterouter
- siterouter/denyset
- vyos
- render
- packages
- apps/site-router
- charts
- docs
- images
- logos
- templates
- tests
- core/platform
- sources
- templates/bundles
- tests
- system
- cozystack-api
- templates
- tests
- cozystack-basics
- templates
- tests
- site-router-controller
- images/site-router-controller
- templates
- tests
- site-router-rd
- cozyrds
- templates
- vyos-router-image
- flavors
- hack
- images/vyos-router-disk
- pkg
- apis/apps/validation
- registry/apps/application
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
35 | 52 | | |
36 | 53 | | |
37 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
165 | 177 | | |
166 | 178 | | |
167 | 179 | | |
| |||
522 | 534 | | |
523 | 535 | | |
524 | 536 | | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
525 | 624 | | |
526 | 625 | | |
527 | 626 | | |
| |||
533 | 632 | | |
534 | 633 | | |
535 | 634 | | |
536 | | - | |
| 635 | + | |
537 | 636 | | |
538 | 637 | | |
539 | 638 | | |
540 | 639 | | |
541 | 640 | | |
542 | 641 | | |
543 | 642 | | |
| 643 | + | |
544 | 644 | | |
545 | 645 | | |
546 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments