apiVersion: v1
kind: Namespace
metadata:
  name: cube-write
---
# write runs as a systemd --user fam service on the host (it spawns `claude`
# which uses Fam's OAuth credentials in ~/.claude). To expose it via traefik
# we point a manual Endpoints object at the node-side of cni0 (10.42.0.1).
apiVersion: v1
kind: Service
metadata:
  name: write
  namespace: cube-write
spec:
  ports:
    - port: 80
      targetPort: 31391
      protocol: TCP
      name: http
---
apiVersion: v1
kind: Endpoints
metadata:
  name: write
  namespace: cube-write
subsets:
  - addresses:
      - ip: 10.42.0.1
    ports:
      - port: 31391
        protocol: TCP
        name: http
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: write
  namespace: cube-write
spec:
  ingressClassName: traefik
  rules:
    - host: write.famzheng.me
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: write
                port:
                  number: 80
