Skip to content

Agent Mesh

fix: route /nodes/catalog through the control-plane gateway

Antonio Ojea5b9d4c0713ea
diff --git a/.github/k8s/sam-control-plane-template.yaml b/.github/k8s/sam-control-plane-template.yaml
index 7793f819..3b50b44b 100644
--- a/.github/k8s/sam-control-plane-template.yaml
+++ b/.github/k8s/sam-control-plane-template.yaml
@@ -216,6 +216,9 @@ spec:
- path:
type: Exact
value: /refresh
+ - path:
+ type: Exact
+ value: /nodes/catalog
backendRefs:
- name: sam-control-plane-${ENV_NAME}
port: 8080
diff --git a/charts/sam-mesh/README.md b/charts/sam-mesh/README.md
index 600e7330..f8c67b84 100644
--- a/charts/sam-mesh/README.md
+++ b/charts/sam-mesh/README.md
@@ -77,7 +77,7 @@ with no default, because the right GatewayClass is provider-specific
The route exposes only the control plane's enrollment surface (`/register`,
`/info`, `/keys`, `/routers/lease`, `/policies`, `/enroll`, `/enroll/status`,
-`/refresh`) and the console under `gateway.consolePath`; everything else,
+`/refresh`, `/nodes/catalog`) and the console under `gateway.consolePath`; everything else,
including `/admin` and `/user`, is unrouted. `gateway.adminRoute: true`
additionally routes `/admin` — a dev convenience, leave it off in production.
diff --git a/charts/sam-mesh/templates/gateway.yaml b/charts/sam-mesh/templates/gateway.yaml
index 8d6105e3..83f4b2e0 100644
--- a/charts/sam-mesh/templates/gateway.yaml
+++ b/charts/sam-mesh/templates/gateway.yaml
@@ -59,6 +59,9 @@ spec:
- path:
type: Exact
value: /refresh
+ - path:
+ type: Exact
+ value: /nodes/catalog
backendRefs:
- name: {{ $fullName }}-control-plane
port: {{ .Values.controlPlane.service.port }}
diff --git a/charts/sam-mesh/tests/gateway_test.yaml b/charts/sam-mesh/tests/gateway_test.yaml
index 23b69ced..d494932e 100644
--- a/charts/sam-mesh/tests/gateway_test.yaml
+++ b/charts/sam-mesh/tests/gateway_test.yaml
@@ -28,6 +28,20 @@ tests:
- lengthEqual:
path: spec.rules
count: 3
+ # Every path a node calls on its own must be on the allow-list, or the
+ # node's periodic push silently 404s at the gateway.
+ - contains:
+ path: spec.rules[0].matches
+ content:
+ path:
+ type: Exact
+ value: /refresh
+ - contains:
+ path: spec.rules[0].matches
+ content:
+ path:
+ type: Exact
+ value: /nodes/catalog
- it: empty consolePath leaves the console unrouted
set: