2026-08-19 22:51:53 -07:00
|
|
|
# Wave 7 — api-gw, the cluster's API gateway (namespace `api`).
|
2026-08-13 07:26:59 -07:00
|
|
|
#
|
2026-08-19 22:51:53 -07:00
|
|
|
# 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.
|
2026-08-13 07:26:59 -07:00
|
|
|
#
|
2026-08-21 20:47:38 -07:00
|
|
|
# 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
|
|
|
|
|
#
|
2026-08-19 22:51:53 -07:00
|
|
|
# Two sources:
|
2026-08-21 20:47:38 -07:00
|
|
|
# 1. rock/homelab-frontend on the in-cluster Forgejo (prod branch) — the gateway's own
|
2026-08-19 22:51:53 -07:00
|
|
|
# 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.
|
2026-08-13 07:26:59 -07:00
|
|
|
#
|
2026-08-19 22:51:53 -07:00
|
|
|
# No resources-finalizer: deleting this Application leaves the workload running
|
|
|
|
|
# rather than cascading the delete.
|
2026-08-13 07:26:59 -07:00
|
|
|
apiVersion: argoproj.io/v1alpha1
|
|
|
|
|
kind: Application
|
|
|
|
|
metadata:
|
2026-08-19 22:51:53 -07:00
|
|
|
name: api-gw
|
2026-08-13 07:26:59 -07:00
|
|
|
namespace: argocd
|
2026-08-19 22:51:53 -07:00
|
|
|
labels:
|
|
|
|
|
app.kubernetes.io/name: api-gateway
|
|
|
|
|
app.kubernetes.io/component: gateway
|
2026-08-13 07:26:59 -07:00
|
|
|
annotations:
|
|
|
|
|
argocd.argoproj.io/sync-wave: "7"
|
|
|
|
|
spec:
|
|
|
|
|
project: homelab
|
|
|
|
|
revisionHistoryLimit: 3
|
|
|
|
|
sources:
|
2026-08-19 22:51:53 -07:00
|
|
|
- repoURL: https://forgejo.riotpiao.com/rock/homelab-frontend.git
|
2026-08-21 20:47:38 -07:00
|
|
|
targetRevision: prod
|
2026-08-19 22:51:53 -07:00
|
|
|
path: k8s
|
2026-08-13 18:02:52 -07:00
|
|
|
- repoURL: https://github.com/Riotpiaole/riotpiao.homelab.com.git
|
2026-08-13 07:26:59 -07:00
|
|
|
targetRevision: main
|
|
|
|
|
path: k8s/apps/api
|
|
|
|
|
destination:
|
|
|
|
|
server: https://kubernetes.default.svc
|
|
|
|
|
namespace: api
|
|
|
|
|
syncPolicy:
|
|
|
|
|
automated:
|
|
|
|
|
prune: true
|
|
|
|
|
selfHeal: true
|
|
|
|
|
syncOptions:
|
|
|
|
|
- CreateNamespace=true
|
|
|
|
|
retry:
|
2026-08-19 22:51:53 -07:00
|
|
|
limit: 5
|
2026-08-13 07:26:59 -07:00
|
|
|
backoff:
|
2026-08-19 22:51:53 -07:00
|
|
|
duration: 5s
|
2026-08-13 07:26:59 -07:00
|
|
|
factor: 2
|
|
|
|
|
maxDuration: 3m
|