|
| 1 | +# balancer deployment manifests |
| 2 | + |
| 3 | +Consumed by the Code for Philly cluster repos |
| 4 | +([cfp-live-cluster](https://github.com/CodeForPhilly/cfp-live-cluster), |
| 5 | +[cfp-sandbox-cluster](https://github.com/CodeForPhilly/cfp-sandbox-cluster)), which project |
| 6 | +`base/` into their GitOps trees. Also usable directly against a local `kind` cluster |
| 7 | +(`deploy/kind-config.yaml`). |
| 8 | + |
| 9 | +## Who owns what |
| 10 | + |
| 11 | +Routing is split along a single line: **this repo declares what the app serves; the |
| 12 | +cluster declares where it's reachable.** |
| 13 | + |
| 14 | +| This repo owns | The cluster owns | |
| 15 | +| --- | --- | |
| 16 | +| `HTTPRoute` — paths, backend Services, ports | `Gateway` — listeners, hostnames, TLS | |
| 17 | +| Deployment, Service, app config | Certificates, ClusterIssuers, `GatewayClass` | |
| 18 | + |
| 19 | +Paths and ports are facts about the application: they change when the app changes, and |
| 20 | +they belong in the same commit as that change. Hostnames, TLS, and issuers are facts |
| 21 | +about the cluster: they differ between live and sandbox, they're negotiated across every |
| 22 | +app sharing the ingress, and they change when the *cluster* changes. |
| 23 | + |
| 24 | +## The contract |
| 25 | + |
| 26 | +**The cluster provides a `Gateway` named after the app, in the app's namespace.** That |
| 27 | +sentence is the whole interface. |
| 28 | + |
| 29 | +`base/httproute.yaml` attaches to it by name and declares no hostnames: |
| 30 | + |
| 31 | +```yaml |
| 32 | +spec: |
| 33 | + parentRefs: |
| 34 | + - name: balancer # the Gateway the cluster provides |
| 35 | + # no hostnames — inherited from the Gateway's listeners |
| 36 | +``` |
| 37 | + |
| 38 | +A route that omits `hostnames` inherits them from the listeners it attaches to. So the |
| 39 | +same file serves `balancerproject.org` in live and `balancer.sandbox.k8s.phl.io` in |
| 40 | +sandbox, with no patching and no placeholders. |
| 41 | + |
| 42 | +## What must NOT live in this repo |
| 43 | + |
| 44 | +Anything that names a cluster implementation detail: |
| 45 | + |
| 46 | +- **`Gateway` or `ListenerSet` resources.** Cluster-owned. |
| 47 | +- **`cert-manager.io/cluster-issuer` annotations**, or any ClusterIssuer name. |
| 48 | +- **TLS `certificateRefs` / cert Secret names.** |
| 49 | +- **`gatewayClassName`**, or the name/namespace of any shared Gateway. |
| 50 | +- **An HTTP→HTTPS redirect.** The cluster already redirects every hostname reaching it |
| 51 | + on port 80. An app-level redirect is redundant, and a route claiming an exact hostname |
| 52 | + on the shared HTTP listener can shadow cert-manager's ACME solver route. |
| 53 | + |
| 54 | +None of these are knowable from this repo, and getting one wrong fails in ways that are |
| 55 | +hard to see. A `ListenerSet`, for instance, applies cleanly to the API server and is then |
| 56 | +silently ignored by Envoy Gateway v1.7.3 — the app simply has no listener, with nothing |
| 57 | +in any log to say why. |
| 58 | + |
| 59 | +If you need something from the cluster that isn't here, open an issue on the cluster repo |
| 60 | +rather than guessing at its internals. |
0 commit comments