From 58bf245920b860f4709b17ca994ebafb74c4b79a Mon Sep 17 00:00:00 2001 From: rock Date: Wed, 4 Nov 2026 04:52:11 +0800 Subject: [PATCH] feat(poimen): publish the memory API at api-poimen.riotpiao.com poimen-memory is a ClusterIP service on :8080, so a local pi session had no route to the API. This adds an edge Ingress on the same nginx class and the same Cloudflare-terminated shape as the frontend ingress. Auth stays ZITADEL JWT (MEM_AUTH_MODE=jwt): a request without a valid bearer token gets 401, so exposing the route does not expose the data. Requires one Cloudflare proxied A record: api-poimen.riotpiao.com -> 192.168.1.160 --- k8s/apps/poimen-frontend/api-ingress.yaml | 38 +++++++++++++++++++++ k8s/apps/poimen-frontend/kustomization.yaml | 2 ++ 2 files changed, 40 insertions(+) create mode 100644 k8s/apps/poimen-frontend/api-ingress.yaml diff --git a/k8s/apps/poimen-frontend/api-ingress.yaml b/k8s/apps/poimen-frontend/api-ingress.yaml new file mode 100644 index 0000000..850143d --- /dev/null +++ b/k8s/apps/poimen-frontend/api-ingress.yaml @@ -0,0 +1,38 @@ +--- +# Public entry point for the poimen-memory HTTP API. +# +# The API was reachable only inside the cluster (ClusterIP :8080), so a local pi +# session had no way to use it. This Ingress exposes the same handler set the +# in-cluster clients use: /mcp, /memory/*, /graphql, /health, /ready. +# +# Cloudflare terminates TLS in front of the nginx ingress, which is why this rule +# carries no `tls:` section — the same shape as ingress.yaml next to it. +# +# Auth: poimen-memory validates ZITADEL JWTs (MEM_AUTH_MODE=jwt). A caller +# without a valid bearer token gets 401, so exposing the route does not expose +# the data. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: poimen-api + namespace: poimen + annotations: + # MCP calls and ingest can be slow; the provider may stream. Match the + # frontend ingress so a long tool call is not cut at 60s. + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-buffering: "off" + nginx.ingress.kubernetes.io/proxy-body-size: "50m" +spec: + ingressClassName: nginx + rules: + - host: api-poimen.riotpiao.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: poimen-memory + port: + number: 8080 diff --git a/k8s/apps/poimen-frontend/kustomization.yaml b/k8s/apps/poimen-frontend/kustomization.yaml index d6e5c12..5cc38b1 100644 --- a/k8s/apps/poimen-frontend/kustomization.yaml +++ b/k8s/apps/poimen-frontend/kustomization.yaml @@ -6,3 +6,5 @@ kind: Kustomization # riotpiao-poimen/poimen-frontend.git k8s/ — each repo owns its own k8s. resources: - ingress.yaml + # The memory API. Without it a local pi session has no route to :8080. + - api-ingress.yaml