Compare commits

..

21 Commits

Author SHA1 Message Date
danijel.simeunovic 2a50028e51 merge
AI Code Review / ai-review (pull_request) Successful in 10s
2026-06-04 15:26:20 +02:00
Sten e5da47efb3 refactor(apps): move forte-drop apps from base to upc-dev overlay
forte-drop, forte-drop-mcp and forte-drop-postgresql lived under apps/base/
but were only ever wired into the upc-dev overlay (never listed in
apps/base/kustomization.yaml). They carry hackathon-domain hardcoded values
and must not sync to upc-prod, so they belong in the overlay alongside
dbunk-demo — per danijel.simeunovic's review on PR #18.

- git mv the three dirs into apps/overlays/upc-dev/ (history preserved)
- rewrite overlay kustomization refs from ../../base/forte-drop* to local
- repoint forte-drop-postgresql Application path
  apps/base/... -> apps/overlays/upc-dev/forte-drop-postgresql/resources

Render-verified: kubectl kustomize apps/overlays/upc-dev differs only by the
postgres path line; apps/overlays/upc-prod render byte-identical (forte-drop
never reaches prod).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 15:22:34 +02:00
Sten e49c0928d2 refactor(apps): registrar-managed oidc creds, drop mcp client, DRY secret
Per platform review (danijel):
- keycloak-client-forte-drop: add the secret{} block telling the
  registrar where to write the credential Secret + key names
  (forte-drop-oidc-credentials, client-id/client-secret). The
  forte-helm oidc sidecar consumes that registrar-created Secret —
  no manual auth-oidc SealedSecret step (removed that NOTE).
- Delete keycloak-client-forte-drop-mcp: auth.type: mcp auto-registers
  the MCP client; no manual config needed.
- Re-seal forte-drop-secrets with all shared env (BASE_DOMAIN, PG*,
  S3_*, PASSWORD_GATE_SECRET) so both deployments get identical values
  via envSecretName (values extraEnv now carries only APP_MODE).
2026-06-04 15:22:05 +02:00
Sten d83cbdc7ca chore(apps): clarify auth-oidc follow-up (drop commented-out resource line)
ai-review: a commented-out resource line reads as GitOps debt. Replace
the '# - auth-oidc-sealed.yaml' line with an explicit NOTE explaining
it's a deliberate post-deploy step (needs the registrar-generated
client-secret), not a disabled resource.
2026-06-04 15:22:05 +02:00
Sten 5913e0c4c0 refactor(apps): move forte-drop postgres from infra to apps
Per reviewer (danijel): forte-drop's DB deployment belongs in apps/,
not infra/. Straight relocation — same structure (Application +
resources/ subdir), source.path updated to apps/base/forte-drop-postgresql/resources,
wired into apps/overlays/upc-dev. Backup CronJob + RESTORE.md + sealed
pg creds move with it.

Consolidates the whole forte-drop deployment (postgres + web + mcp)
under apps/. The infra PR (#17) is now superseded by this.
2026-06-04 15:22:05 +02:00
Sten 6f6f8c1c55 fix(apps): explicit forte-drop namespace (sync-wave -1, Prune=false)
Codex review: the apps overlay applies namespaced resources
(keycloak-client Secrets, forte-drop-secrets, PDB) to forte-drop, but
no base created the namespace — first sync on a fresh cluster raced
ahead of the Applications' CreateNamespace and failed with
'namespaces forte-drop not found' until a retry.

Add an explicit Namespace at sync-wave -1 so it exists before the
wave-0 namespaced resources (covers both web + mcp bases via the
shared parent). Prune=false keeps removing a base from cascade-
deleting the namespace + postgres data + the other deployment.
2026-06-04 15:22:04 +02:00
Sten 6d25437e98 feat(apps): add forte-drop-secrets sealed secret
Sealed forte-drop-secrets with the real UpCloud Managed Object Storage
creds (existing drops bucket), PG creds matching the deployed
forte-drop-pg-creds, and PASSWORD_GATE_SECRET. Consumed by both web +
mcp deployments (envSecretName) and the pg-backup CronJob (S3 creds).
2026-06-04 15:22:04 +02:00
Sten 46f2d2d661 feat(apps): PodDisruptionBudget for forte-drop web (minAvailable 1) 2026-06-04 15:22:04 +02:00
danijel.simeunovic c840dbb4b5 merge 2026-06-04 15:21:35 +02:00
Sten a1a7c048c1 docs(apps): clarify mcp deployment needs no auth-oidc secret 2026-06-04 14:53:18 +02:00
Sten d6e61c5663 feat(apps): forte-drop web + mcp ArgoCD applications
Two ArgoCD apps from the same forte-drop image:
- forte-drop (web): admin + public drops, sidecar in oidc mode,
  ingress drop-k8s.hackathon.forteapps.net.
- forte-drop-mcp (mcp): MCP-over-HTTP, sidecar in mcp mode,
  ingress mcp.drop-k8s.hackathon.forteapps.net.

Plus two labeled Keycloak client config Secrets — the registrar
creates the OIDC clients in the forte realm within ~2 min.

Sealed secrets (forte-drop-secrets + auth-oidc) added in a
follow-up commit by the maintainer:
  cd /Users/sten/dev/work/forte_k8/launchpad
  kubeseal --format=yaml \
    --controller-name=sealed-secrets-controller \
    --controller-namespace=kube-system \
    < private/forte-drop-secrets.yaml \
    > apps/base/forte-drop/forte-drop-secrets-sealed.yaml
  # auth-oidc: wait for registrar, copy client-secret into private/,
  # then seal as apps/base/forte-drop/auth-oidc-sealed.yaml.
  # (mcp deployment is sidecar type=mcp — no auth-oidc Secret needed;
  # only the web deployment requires it.)
2026-06-04 14:53:18 +02:00
Sten 335dd1366d refactor(apps): move forte-drop apps from base to upc-dev overlay
AI Code Review / ai-review (pull_request) Successful in 6s
forte-drop, forte-drop-mcp and forte-drop-postgresql lived under apps/base/
but were only ever wired into the upc-dev overlay (never listed in
apps/base/kustomization.yaml). They carry hackathon-domain hardcoded values
and must not sync to upc-prod, so they belong in the overlay alongside
dbunk-demo — per danijel.simeunovic's review on PR #18.

- git mv the three dirs into apps/overlays/upc-dev/ (history preserved)
- rewrite overlay kustomization refs from ../../base/forte-drop* to local
- repoint forte-drop-postgresql Application path
  apps/base/... -> apps/overlays/upc-dev/forte-drop-postgresql/resources

Render-verified: kubectl kustomize apps/overlays/upc-dev differs only by the
postgres path line; apps/overlays/upc-prod render byte-identical (forte-drop
never reaches prod).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 12:26:07 +02:00
Sten 338b4de3ba refactor(apps): registrar-managed oidc creds, drop mcp client, DRY secret
AI Code Review / ai-review (pull_request) Successful in 5s
Per platform review (danijel):
- keycloak-client-forte-drop: add the secret{} block telling the
  registrar where to write the credential Secret + key names
  (forte-drop-oidc-credentials, client-id/client-secret). The
  forte-helm oidc sidecar consumes that registrar-created Secret —
  no manual auth-oidc SealedSecret step (removed that NOTE).
- Delete keycloak-client-forte-drop-mcp: auth.type: mcp auto-registers
  the MCP client; no manual config needed.
- Re-seal forte-drop-secrets with all shared env (BASE_DOMAIN, PG*,
  S3_*, PASSWORD_GATE_SECRET) so both deployments get identical values
  via envSecretName (values extraEnv now carries only APP_MODE).
2026-05-29 14:05:29 +02:00
Sten 61a8a2b4ac chore(apps): clarify auth-oidc follow-up (drop commented-out resource line)
AI Code Review / ai-review (pull_request) Successful in 6s
ai-review: a commented-out resource line reads as GitOps debt. Replace
the '# - auth-oidc-sealed.yaml' line with an explicit NOTE explaining
it's a deliberate post-deploy step (needs the registrar-generated
client-secret), not a disabled resource.
2026-05-29 12:14:09 +02:00
Sten 96db244e03 refactor(apps): move forte-drop postgres from infra to apps
AI Code Review / ai-review (pull_request) Successful in 6s
Per reviewer (danijel): forte-drop's DB deployment belongs in apps/,
not infra/. Straight relocation — same structure (Application +
resources/ subdir), source.path updated to apps/base/forte-drop-postgresql/resources,
wired into apps/overlays/upc-dev. Backup CronJob + RESTORE.md + sealed
pg creds move with it.

Consolidates the whole forte-drop deployment (postgres + web + mcp)
under apps/. The infra PR (#17) is now superseded by this.
2026-05-29 10:38:51 +02:00
Sten d6a97a22df fix(apps): explicit forte-drop namespace (sync-wave -1, Prune=false)
AI Code Review / ai-review (pull_request) Successful in 1m40s
Codex review: the apps overlay applies namespaced resources
(keycloak-client Secrets, forte-drop-secrets, PDB) to forte-drop, but
no base created the namespace — first sync on a fresh cluster raced
ahead of the Applications' CreateNamespace and failed with
'namespaces forte-drop not found' until a retry.

Add an explicit Namespace at sync-wave -1 so it exists before the
wave-0 namespaced resources (covers both web + mcp bases via the
shared parent). Prune=false keeps removing a base from cascade-
deleting the namespace + postgres data + the other deployment.
2026-05-29 10:25:37 +02:00
Sten c4b7167f9e feat(apps): add forte-drop-secrets sealed secret
Sealed forte-drop-secrets with the real UpCloud Managed Object Storage
creds (existing drops bucket), PG creds matching the deployed
forte-drop-pg-creds, and PASSWORD_GATE_SECRET. Consumed by both web +
mcp deployments (envSecretName) and the pg-backup CronJob (S3 creds).
2026-05-29 10:03:57 +02:00
Sten 6bc5bd29b3 feat(apps): PodDisruptionBudget for forte-drop web (minAvailable 1) 2026-05-29 09:31:16 +02:00
Sten 5f6fb9b152 fix(apps): scope forte-drop to upc-dev only, not via base
forte-drop and forte-drop-mcp have hackathon-domain values hardcoded
(drop-k8s.hackathon.forteapps.net). Listing them in apps/base/
syncs them to both upc-dev and upc-prod overlays — prod sync would
create broken Applications pointing at non-existent prod ingress.

Move references to apps/overlays/upc-dev/ only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:28:51 +02:00
Sten dbe67a4d56 docs(apps): clarify mcp deployment needs no auth-oidc secret 2026-05-28 16:51:04 +02:00
Sten a2fae9dd0c feat(apps): forte-drop web + mcp ArgoCD applications
Two ArgoCD apps from the same forte-drop image:
- forte-drop (web): admin + public drops, sidecar in oidc mode,
  ingress drop-k8s.hackathon.forteapps.net.
- forte-drop-mcp (mcp): MCP-over-HTTP, sidecar in mcp mode,
  ingress mcp.drop-k8s.hackathon.forteapps.net.

Plus two labeled Keycloak client config Secrets — the registrar
creates the OIDC clients in the forte realm within ~2 min.

Sealed secrets (forte-drop-secrets + auth-oidc) added in a
follow-up commit by the maintainer:
  cd /Users/sten/dev/work/forte_k8/launchpad
  kubeseal --format=yaml \
    --controller-name=sealed-secrets-controller \
    --controller-namespace=kube-system \
    < private/forte-drop-secrets.yaml \
    > apps/base/forte-drop/forte-drop-secrets-sealed.yaml
  # auth-oidc: wait for registrar, copy client-secret into private/,
  # then seal as apps/base/forte-drop/auth-oidc-sealed.yaml.
  # (mcp deployment is sidecar type=mcp — no auth-oidc Secret needed;
  # only the web deployment requires it.)
2026-05-28 16:47:38 +02:00
9 changed files with 34 additions and 102 deletions
@@ -1,39 +0,0 @@
# Wildcard routing for per-slug forte drops: <slug>.drop.forteapps.net -> the forte-drop
# web pod. The forteapp chart only emits a single exact Host(`drop.forteapps.net`) route
# (the apex: admin + /api + public /shared drops), so this ADDITIVE IngressRoute adds the
# wildcard. Kept in launchpad (forte-drop-specific) rather than the shared forteapp chart.
#
# It targets the SAME service the chart's route does — forte-drop-app:3000 — whose
# targetPort is the auth sidecar (service.yaml: targetPort = auth.sidecarPort when auth is
# on). So wildcard subdomains flow service:3000 -> sidecar -> app, i.e. they are Forte-login
# gated exactly like the admin root. A forteOnly drop is therefore never served un-gated.
#
# priority: 1 (intentionally LOW). Traefik orders routers by rule-length by default, and the
# regex string is longer than Host(`mcp.drop.forteapps.net`); without an explicit low
# priority this regex would OUTRANK and STEAL mcp.drop.forteapps.net (and the apex) into the
# web pod. priority:1 guarantees the exact Host() routers (mcp release, chart apex) always win;
# only real per-slug subdomains fall through to here. The app's reserved-slug check
# (mcp/www/api/admin/app) is a second line of defence.
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: forte-drop-subdomains
namespace: forte-drop
labels:
app.kubernetes.io/name: forte-drop
app.kubernetes.io/part-of: apps
app.kubernetes.io/managed-by: argocd
spec:
entryPoints:
- websecure
routes:
# Traefik v3 (chart 28.x) HostRegexp takes a Go RE2 pattern. Verify the rendered
# router against mcp./www./app./apex/<real-slug> before relying on it in prod.
- match: HostRegexp(`^[a-z0-9-]+\.drop\.forteapps\.net$`)
kind: Rule
priority: 1
services:
- name: forte-drop-app
port: 3000
tls:
secretName: wildcard-drop-forteapps-net-tls
@@ -5,9 +5,9 @@ metadata:
namespace: argocd namespace: argocd
annotations: annotations:
argocd.argoproj.io/sync-wave: "1" argocd.argoproj.io/sync-wave: "1"
# notifications.argoproj.io/subscribe.on-sync-succeeded.slack: "" notifications.argoproj.io/subscribe.on-sync-succeeded.slack: ""
# notifications.argoproj.io/subscribe.on-sync-failed.slack: "" notifications.argoproj.io/subscribe.on-sync-failed.slack: ""
# notifications.argoproj.io/subscribe.on-degraded.slack: "" notifications.argoproj.io/subscribe.on-degraded.slack: ""
labels: labels:
app.kubernetes.io/name: forte-drop app.kubernetes.io/name: forte-drop
app.kubernetes.io/part-of: apps app.kubernetes.io/part-of: apps
@@ -24,8 +24,8 @@ stringData:
"directAccessGrantsEnabled": false, "directAccessGrantsEnabled": false,
"serviceAccountsEnabled": false, "serviceAccountsEnabled": false,
"publicClient": false, "publicClient": false,
"redirectUris": ["https://drop.forteapps.net/auth/callback"], "redirectUris": ["https://drop-k8s.hackathon.forteapps.net/auth/callback"],
"webOrigins": ["https://drop.forteapps.net"], "webOrigins": ["https://drop-k8s.hackathon.forteapps.net"],
"defaultClientScopes": ["openid","email","profile"], "defaultClientScopes": ["openid","email","profile"],
"secret": { "secret": {
"namespace": "forte-drop", "namespace": "forte-drop",
@@ -1,9 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- namespace.yaml
- forte-drop.yaml - forte-drop.yaml
- keycloak-client-forte-drop.yaml - keycloak-client-forte-drop.yaml
- forte-drop-pdb.yaml - forte-drop-pdb.yaml
- forte-drop-secrets-sealed.yaml - forte-drop-secrets-sealed.yaml
- wildcard-drop-tls-certificate.yaml
- forte-drop-subdomains-ingressroute.yaml
@@ -0,0 +1,17 @@
# Owns the forte-drop namespace shared by the web + mcp deployments and the
# postgres StatefulSet (infra overlay). sync-wave -1 ensures the namespace exists
# before the namespaced Secrets/PDB in this base apply (avoids a first-sync
# "namespaces forte-drop not found" race when the business-apps parent syncs).
# Prune=false so removing this base never cascade-deletes the namespace (and with
# it postgres data + the mcp deployment) — matches the earlier decision to keep
# namespace ownership decoupled from any single workload.
apiVersion: v1
kind: Namespace
metadata:
name: forte-drop
annotations:
argocd.argoproj.io/sync-wave: "-1"
argocd.argoproj.io/sync-options: Prune=false
labels:
app.kubernetes.io/managed-by: argocd
app.kubernetes.io/part-of: apps
@@ -1,35 +0,0 @@
---
# Wildcard TLS cert for the per-slug drop subdomains: <slug>.drop.forteapps.net.
# forte_drop serves forte-login drops on their own subdomain (gated by the auth
# sidecar), so each drop needs a valid cert for *.drop.forteapps.net — a name the
# existing *.forteapps.net wildcard CANNOT cover (TLS wildcards match one label only).
#
# Scope: this cert covers ONLY *.drop.forteapps.net. The apex drop.forteapps.net is
# NOT included here — it is served by the forteapp chart's own Certificate (secret
# forte-drop-tls, dnsNames: [drop.forteapps.net]) and/or the existing *.forteapps.net
# wildcard, so adding it here would be redundant.
#
# Issued DIRECTLY into the forte-drop namespace (not via the chart) so the app's
# Traefik IngressRoute — which must reference a TLS secret in its OWN namespace — can
# use it without cross-namespace cloning. This is the single issuer of secret
# wildcard-drop-forteapps-net-tls; the forte-drop-subdomains IngressRoute references
# that secret. The letsencrypt-prod dns01 solver is authorized for this name via its
# selector.dnsZones (forteapps.net).
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: wildcard-drop-forteapps-net
namespace: forte-drop
spec:
secretName: wildcard-drop-forteapps-net-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- '*.drop.forteapps.net' # per-slug forte drop subdomains
duration: 2160h0m0s # 90 days
renewBefore: 720h0m0s # renew 30 days before expiry
privateKey:
algorithm: RSA
encoding: PKCS1
size: 4096
+3 -3
View File
@@ -8,6 +8,6 @@ resources:
# No patches needed — base apps already default to "upc-dev" value paths # No patches needed — base apps already default to "upc-dev" value paths
# (upc-dev is the default/base cluster). # (upc-dev is the default/base cluster).
# forte-drop (postgres + web + mcp) and dbunk-demo are upc-dev-only apps — their # forte-drop (postgres + web + mcp) and dbunk-demo are upc-dev-only apps — they
# values hardcode upc-dev hosts (drop.forteapps.net etc.) and must not sync to # have hackathon-domain hardcoded values and must not sync to upc-prod, so they
# upc-prod, so they live here in the overlay rather than in apps/base/. # live here in the overlay rather than in apps/base/.
+4 -18
View File
@@ -24,15 +24,8 @@ spec:
name: azuredns-config name: azuredns-config
key: client-secret key: client-secret
selector: selector:
# NOTE: cert-manager solver selectors are NOT TLS-style wildcards. selector.dnsNames dnsNames:
# matches by exact FQDN, so '*.forteapps.net' here would match only a cert literally - '*.forteapps.net'
# named '*.forteapps.net' — it would NOT cover 'drop.forteapps.net'. selector.dnsZones
# instead suffix-matches the zone apex AND every subdomain at any depth, so this single
# entry routes all forteapps.net ACME challenges (forteapps.net, *.forteapps.net,
# drop.forteapps.net, *.drop.forteapps.net, mcp.drop.forteapps.net, ...) through this
# Azure dns01 solver. Wildcard names require dns01; non-wildcard names that ever fail
# to match fall through to the http01 solver below.
dnsZones:
- 'forteapps.net' - 'forteapps.net'
# HTTP-01 fallback for non-wildcard certificates # HTTP-01 fallback for non-wildcard certificates
- http01: - http01:
@@ -65,15 +58,8 @@ spec:
name: azuredns-config name: azuredns-config
key: client-secret key: client-secret
selector: selector:
# NOTE: cert-manager solver selectors are NOT TLS-style wildcards. selector.dnsNames dnsNames:
# matches by exact FQDN, so '*.forteapps.net' here would match only a cert literally - '*.forteapps.net'
# named '*.forteapps.net' — it would NOT cover 'drop.forteapps.net'. selector.dnsZones
# instead suffix-matches the zone apex AND every subdomain at any depth, so this single
# entry routes all forteapps.net ACME challenges (forteapps.net, *.forteapps.net,
# drop.forteapps.net, *.drop.forteapps.net, mcp.drop.forteapps.net, ...) through this
# Azure dns01 solver. Wildcard names require dns01; non-wildcard names that ever fail
# to match fall through to the http01 solver below.
dnsZones:
- 'forteapps.net' - 'forteapps.net'
# HTTP-01 fallback for non-wildcard certificates # HTTP-01 fallback for non-wildcard certificates
- http01: - http01:
@@ -59,6 +59,10 @@ config:
href: https://benken.hackathon.forteapps.net href: https://benken.hackathon.forteapps.net
description: Teknisk kompetanse fra offentlige anbud description: Teknisk kompetanse fra offentlige anbud
icon: forte icon: forte
- Forte Drop:
href: https://drop.hackathon.forteapps.net
description: Self-hosted HTML-drops + MCP for Claude
icon: forte
- Forte Feedback: - Forte Feedback:
href: https://feedback.forteapps.net href: https://feedback.forteapps.net
description: Fortes internal feedback app description: Fortes internal feedback app