Files
homelab/k8s/argocd/apps/55-api-gateway.yaml
T

66 lines
2.6 KiB
YAML
Raw Normal View History

# Wave 7 — api-gw, the cluster's API gateway (namespace `api`).
#
# Replaces Kong OSS 3.4.1, removed 2026-08-19. Kong existed to route
# `api.riotpiao.com`, but Kong OSS cannot dispatch on a request body, so the
# LLM surface had to be expressed as one path per model
# (`/v1/reasoning/chat/completions`, `/v1/ornith/...`, `/v1/qwen/...`) with a
# `request-transformer` plugin forcing the body's `model` field on each. The Go
# gateway reads the body and picks the upstream, so a single canonical
# `POST /v1/chat/completions` covers every model. See
# docs/adr/ADR-0001-retire-kong-for-go-gateway.md in the frontend repo.
#
# UPDATED 2026-08-21: Tracks prod branch of homelab-frontend (not main).
# Image promotion via kustomization:
# cd k8s && kustomize edit set image forgejo.riotpiao.com/rock/api-gateway=forgejo.riotpiao.com/rock/api-gateway:<commit-sha>
# git add kustomization.yaml && git commit -m "chore(deploy): promote api-gateway to <commit-sha>"
# git push origin prod
#
# Two sources:
# 1. rock/homelab-frontend on the in-cluster Forgejo (prod branch) — the gateway's own
# kustomization (Deployment, Service, ConfigMap, RBAC, NetworkPolicy). It
# sets `namespace: api` itself, so no transformer is needed here. The
# Forgejo host must stay listed in the `homelab` AppProject sourceRepos or
# this Application is rejected with "is not permitted in project".
# 2. k8s/apps/api in this repo — the nginx edge Ingress for
# api.riotpiao.com, inherited from the retired `kong` Application. It
# cannot move to k8s/bootstrap/ingress/ingress.yaml because that syncs in
# wave 1, before namespace `api` exists.
#
# No resources-finalizer: deleting this Application leaves the workload running
# rather than cascading the delete.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: api-gw
namespace: argocd
labels:
app.kubernetes.io/name: api-gateway
app.kubernetes.io/component: gateway
annotations:
argocd.argoproj.io/sync-wave: "7"
spec:
project: homelab
revisionHistoryLimit: 3
sources:
- repoURL: https://forgejo.riotpiao.com/rock/homelab-frontend.git
targetRevision: prod
path: k8s
- repoURL: https://github.com/Riotpiaole/riotpiao.homelab.com.git
targetRevision: main
path: k8s/apps/api
destination:
server: https://kubernetes.default.svc
namespace: api
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m