Skip to content

Commit 268b91c

Browse files
feat(site-router): add app chart skeleton and generated API types
Add the site-router catalog app chart mirroring the vpn app layout: an umbrella application chart with a cozy-lib dependency, annotated values.yaml, generated values.schema.json / README.md, a placeholder logo, and the standard _helpers.tpl. The values schema covers the PR #30 routed subset: a single-value `tunnel.type` enum (ipsec, kept an enum for forward-compat), a singular `peer` (one tunnel per instance) with address and IPsec PSK auth, `remoteCIDRs`, optional `staticRoutes`, optional BGP peering (disabled by default), and explicit `resources{cpu,memory}` VM sizing (no size enum, per decision D11). The chart body is intentionally a near-empty stub; the VM/LB/secret templates land in T04. Generated kubebuilder types are placed in the api/apps/v1alpha1/siterouter Go submodule via cozyvalues-gen (-m siterouter), with deepcopy produced by controller-gen. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 4b612ce commit 268b91c

11 files changed

Lines changed: 649 additions & 0 deletions

File tree

‎api/apps/v1alpha1/siterouter/types.go‎

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/siterouter/zz_generated.deepcopy.go‎

Lines changed: 193 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.helmignore
2+
/logos
3+
/Makefile
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v2
2+
name: site-router
3+
description: Managed site-to-site router
4+
icon: /logos/site-router.svg
5+
type: application
6+
version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process
7+
appVersion: "1.5-rolling"
8+
dependencies:
9+
- name: cozy-lib
10+
version: "*"
11+
repository: "file://charts/cozy-lib"

‎packages/apps/site-router/Makefile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include ../../../hack/package.mk
2+
3+
generate:
4+
cozyvalues-gen -m 'siterouter' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/siterouter/types.go
5+
../../../hack/update-crd.sh
6+
7+
test:
8+
helm unittest .
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Managed Site-to-Site Router
2+
3+
Site Router connects a Cozystack tenant network to a remote network over an IPsec site-to-site tunnel. It runs a VyOS-based router VM in the tenant namespace and programs the routed data path (static routes, optional BGP) so that the configured remote networks become reachable from the tenant workloads and vice versa.
4+
5+
- One tunnel per instance (single remote peer). Reach a second site by deploying a second instance.
6+
- Responder model: the remote peer dials in to the public tunnel endpoint.
7+
8+
## Parameters
9+
10+
### Tunnel configuration
11+
12+
| Name | Description | Type | Value |
13+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
14+
| `tunnel` | Site-to-site tunnel configuration. | `object` | `{}` |
15+
| `tunnel.type` | Tunnel protocol used to connect to the remote peer. | `string` | `ipsec` |
16+
| `peer` | Remote peer this router builds a tunnel to. | `object` | `{}` |
17+
| `peer.address` | Public address (IP or hostname) of the remote peer. Responder model: the remote peer dials in. | `string` | `""` |
18+
| `peer.auth` | IPsec authentication material for the tunnel. | `object` | `{}` |
19+
| `peer.auth.psk` | IPsec pre-shared key. Autogenerated and stored in a Secret when omitted. Mutually exclusive with `existingSecret`. | `string` | `""` |
20+
| `peer.auth.existingSecret` | Name of an existing Secret in the tenant namespace holding the pre-shared key (key `psk`). Takes precedence over `psk` when set. | `string` | `""` |
21+
22+
23+
### Routing configuration
24+
25+
| Name | Description | Type | Value |
26+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------- |
27+
| `remoteCIDRs` | Remote networks reachable over the tunnel. Must be disjoint from the cluster pod/service/join networks (validated by the controller). | `[]string` | `[]` |
28+
| `staticRoutes` | Optional extra static routes programmed on the router. | `[]object` | `[]` |
29+
| `staticRoutes[i].destination` | Destination network in CIDR notation. | `string` | `""` |
30+
| `staticRoutes[i].nextHop` | Next-hop IP address for the destination. | `string` | `""` |
31+
| `bgp` | Optional BGP peering over the tunnel. Disabled by default. | `object` | `{}` |
32+
| `bgp.enabled` | Enable BGP peering. | `bool` | `false` |
33+
| `bgp.localASN` | Local autonomous system number. | `int` | `0` |
34+
| `bgp.neighbors` | BGP neighbors to peer with. | `[]object` | `[]` |
35+
| `bgp.neighbors[i].address` | Neighbor IP address. | `string` | `""` |
36+
| `bgp.neighbors[i].remoteASN` | Remote autonomous system number of the neighbor. | `int` | `0` |
37+
38+
39+
### Common parameters
40+
41+
| Name | Description | Type | Value |
42+
| ------------------ | ------------------------------------------------- | ---------- | ----- |
43+
| `resources` | Explicit CPU and memory sizing for the router VM. | `object` | `{}` |
44+
| `resources.cpu` | CPU cores allocated to the router VM. | `quantity` | `2` |
45+
| `resources.memory` | Memory (RAM) allocated to the router VM. | `quantity` | `2Gi` |
46+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../library/cozy-lib
Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)