Changeset 0.6.0 (#36)

This commit is contained in:
2026-02-20 22:24:47 +00:00
parent 30d0c11219
commit 925b70f98c
34 changed files with 2575 additions and 637 deletions

View File

@@ -2,11 +2,18 @@
# ============================================
# Chat Switchboard - Ingress
# ============================================
# Routes for a single subdomain:
# /api/* → backend service (Go API on :8080)
# /health → backend service (health check)
# /ws → backend service (WebSocket, upgraded)
# /* → frontend service (nginx SPA on :80)
# Path-based routing on a single domain:
# switchboard.DOMAIN/ → production
# switchboard.DOMAIN/test/ → test (main branch)
# switchboard.DOMAIN/dev/ → dev (PR branches)
#
# Each environment deploys its own Ingress resource.
# Traefik merges rules for the same host automatically.
# Longer path prefixes take priority (Traefik default).
#
# BASE_PATH is empty for prod, "/test" or "/dev" for others.
# Backend handles BASE_PATH via r.Group(cfg.BasePath).
# Frontend entrypoint injects BASE_PATH into nginx + HTML.
# ============================================
apiVersion: networking.k8s.io/v1
kind: Ingress
@@ -24,13 +31,13 @@ spec:
tls:
- hosts:
- ${DEPLOY_HOST}
secretName: switchboard${DEPLOY_SUFFIX}-tls
secretName: switchboard-tls
rules:
- host: "${DEPLOY_HOST}"
http:
paths:
# API routes → backend
- path: /api
- path: ${BASE_PATH}/api
pathType: Prefix
backend:
service:
@@ -38,7 +45,7 @@ spec:
port:
number: 8080
# Health check → backend
- path: /health
- path: ${BASE_PATH}/health
pathType: Exact
backend:
service:
@@ -46,15 +53,15 @@ spec:
port:
number: 8080
# WebSocket → backend (traefik handles upgrade automatically)
- path: /ws
- path: ${BASE_PATH}/ws
pathType: Exact
backend:
service:
name: switchboard-be${DEPLOY_SUFFIX}
port:
number: 8080
# Everything else → frontend
- path: /
# Everything else under this prefix → frontend
- path: ${BASE_PATH}/
pathType: Prefix
backend:
service: