Files
bikoret/deploy/k8s/service.yaml
T
Scott KarpandClaude Fable 5.1 f19a5ea007 gate: Claude Code behind it — OAuth bearer, anthropic-beta, token counting, the gate's own watch
A coding agent's traffic differs from a hand-made request: with a
subscription Claude Code authenticates with an OAuth bearer and sends
anthropic-beta; it counts tokens at /v1/messages/count_tokens; it makes a
request per tool call; its tool-only turns have no text; its context runs
to megabytes. So: with the courtyard key in X-Bikoret-Key, the caller's
Authorization: Bearer is forwarded to Anthropic as its credential, and
anthropic-beta with it; count_tokens is carried through unexamined and
uncharged; the watch counts the gate at its own windows (120/min,
2,000/h per key — tier :gate); a reply with no text is delivered as it
came with bikoret.verdict "none" and no fringe block (stream and
non-stream); the sources keep the newest user turns whole and drop the
oldest past 1 MiB. Ingress body 32 MiB; ConfigMap manna amounts raised
to 5000/5000 (the kohen's lever). Tamid §1.1, KOHEN "Claude Code behind
the gate". Doorpost re-pinned. Elixir 617/0 read before this commit;
gate_test 25.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 15:51:31 +00:00

154 lines
4.7 KiB
YAML

# Bikoret Services
# Operations spec §1.1: Four access tiers
# - Pe'ah (public, no auth)
# - Machaneh Leviyah (authenticated)
# - Chatzer (full access)
# - Kodesh (operator, mTLS)
#
# All tiers go through a single Service → vav-pipeline port 4000
---
apiVersion: v1
kind: Service
metadata:
name: shorashim
namespace: shorashim
labels:
app.kubernetes.io/name: shorashim
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: shorashim
ports:
- port: 80
targetPort: 4000
protocol: TCP
name: http
---
# ============================================================
# The gate to the world — through the shared ingress
# ============================================================
#
# Until 2026-10-06 Bikoret had its own LoadBalancer Service
# (`shorashim-external`, NLB 185.19.29.180, NodePort 30923). It is gone:
# one NLB per Service was a third of the account's bill, and the pod saw
# every caller as the node (kube-proxy SNAT) so the pe'ah's per-IP watch
# could not tell callers apart. The ingress-nginx Service is already
# externalTrafficPolicy: Local with its health-check port open, so the
# controller sees the caller and hands it on in X-Real-IP; the pipeline
# believes that header only from TRUSTED_PROXIES (configmap.yaml).
#
# Hosts (2026-10-13, the name): bikoret.ch is the place; www.bikoret.ch
# and the old shorashim.ch are served too; bikoret.org (second Ingress
# below) only redirects. TLS from Let's Encrypt through cert-manager's
# letsencrypt-prod ClusterIssuer, HTTP-01 — so apply this ONLY after
# `dig +short A bikoret.ch` answers 185.19.28.170: a certificate asked
# for before the name resolves only burns the failed-validation limit.
# The no-host catch-all stays, so http://<ingress-ip>/... keeps working
# with no DNS; with ssl-redirect on, named hosts go to https.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: shorashim
namespace: shorashim
labels:
app.kubernetes.io/name: shorashim
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
# A 71-judge Sanhedrin may deliberate for ten minutes (Construction §2.2).
nginx.ingress.kubernetes.io/proxy-read-timeout: "620"
nginx.ingress.kubernetes.io/proxy-send-timeout: "620"
# The bedikah accepts 65,536 bytes of output and 1 MiB of sources; a
# coding agent's request through the gate carries its whole context.
nginx.ingress.kubernetes.io/proxy-body-size: "32m"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: nginx
tls:
- hosts:
- bikoret.ch
- www.bikoret.ch
secretName: bikoret-tls
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: shorashim
port:
number: 80
- host: bikoret.ch
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: shorashim
port:
number: 80
- host: www.bikoret.ch
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: shorashim
port:
number: 80
# The old name, kept until its callers have moved; no certificate asked for it.
- host: shorashim.ch
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: shorashim
port:
number: 80
---
# bikoret.org: the stranger's guess, redirected to the place. No service
# of its own; nginx answers the redirect itself. Add its A records too.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: bikoret-org
namespace: shorashim
labels:
app.kubernetes.io/name: shorashim
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
# The admission webhook refuses `$request_uri` in this annotation; the bare host is enough for a redirect domain.
nginx.ingress.kubernetes.io/permanent-redirect: https://bikoret.ch
spec:
ingressClassName: nginx
tls:
- hosts:
- bikoret.org
- www.bikoret.org
secretName: bikoret-org-tls
rules:
- host: bikoret.org
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: shorashim
port:
number: 80
- host: www.bikoret.org
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: shorashim
port:
number: 80