Skip to content

ADR-021 — Catalog Manager Pro

Contexte

AKKO doit permettre à un client de brancher sa propre source de données (PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery, Databricks, Kafka, HDFS+Hive+Kerberos legacy…) en auto-service depuis le cockpit, sans intervention DevOps ni rolling restart. Niveau attendu : Starburst.

Bloqueurs historiques résolus (Sprint 39) : - Trino 480 → 480 upgrade (activation catalog.management=dynamic) - catalog.store=memory activé dans coordinatorExtraConfig

Décision

Construire AKKO Catalog Manager Pro comme sub-chart akko-catalog-manager (Sprint 41), composé de :

  1. Backend API (FastAPI, Python, Apache 2.0) — docker/catalog-manager/
  2. UI cockpit — nouvelle page Admin → Catalogs (branding/cockpit)
  3. Auto-OPA sidecar — watcher qui injecte règles Rego par catalog
  4. Auto-OpenMetadata trigger — déclenche ingestion à l'ajout
  5. Connector library — 18 connecteurs pré-configurés

Architecture

┌─────────────────┐       ┌───────────────────────┐
│ Cockpit Admin   │       │  catalog-manager API  │
│ → Catalogs page │──POST─▶  /api/catalogs        │
└─────────────────┘       │  (FastAPI)            │
                          └──────────┬────────────┘
             ┌───────────────────────┼───────────────────┐
             ▼                       ▼                   ▼
   ┌──────────────────┐   ┌──────────────────┐  ┌────────────────────┐
   │ Vault /          │   │ Trino REST API   │  │ OPA watcher sidecar│
   │ ExternalSecrets  │   │ POST /v1/catalog │  │ (auto-Rego rules)  │
   │ (credentials)    │   │ (dynamic reg)    │  │ + OM ingest job    │
   └──────────────────┘   └──────────────────┘  └────────────────────┘

Connecteurs supportés (MVP Sprint 41)

Catégorie Connecteur Trino Auth Notes
Relational postgresql JDBC user/password climascore simulation
mysql JDBC user/password
sqlserver JDBC user/password
oracle JDBC user/password OCI driver bundled
Lakehouse iceberg (REST) OAuth2 Polaris
iceberg (Hive MS) Hive Metastore Hive 3 + Kerberos
delta-lake S3 + Hive MS
hive HMS thrift HDFS 3 + Kerberos
Cloud DW snowflake JDBC
bigquery Service account
redshift JDBC
databricks (Unity Catalog) Personal Access Token
NoSQL mongodb user/password
cassandra user/password
elasticsearch Bearer / basic
Streaming kafka SASL_SSL
Object store delta, hive + S3 access/secret key
Meta jmx, memory, tpch, tpcds perfs + tests

Workflow ajout d'un catalog (zéro downtime)

1. Admin ouvre Cockpit → Admin → Catalogs → "+"
2. Sélectionne le type (PostgreSQL, Hive+Kerberos, ...)
3. Remplit le formulaire : nom, host, port, db, credentials
   + upload keytab (Hive+Kerberos) + core-site.xml
4. Back-end catalog-manager :
   a. Test la connexion JDBC / thrift (fail-fast si KO)
   b. Stocke credentials dans Vault (secret ExternalSecret)
   c. Génère le .properties Trino dans memory catalog store
   d. POST http://akko-trino:8080/v1/catalog
      { "catalogName": "<name>", "connectorName": "postgresql", ... }
   e. Déclenche POST OpenMetadata /api/v1/services/ingest
   f. Écrit les règles OPA auto-générées dans ConfigMap akko-opa-catalogs
5. Trino recharge à chaud (aucun restart pod)
6. UI affiche status "active" + query test runné (SELECT 1 via Trino)

Sécurité

  • Credentials JAMAIS en ConfigMap ou env var claire : toujours via Vault/SealedSecrets/ExternalSecrets
  • Backend catalog-manager authentifié Keycloak (role akko-admin uniquement pour CRUD)
  • Audit log JSON structuré pour chaque ajout/suppression/modification
  • Signature HMAC du catalog config (détection tampering)
  • Test connection en dry-run avant activation (pas de credentials en mémoire Trino si fail)

Kerberos / HDFS legacy (Cloudera CDP 7.1.9)

  • Keytab uploadé via form → K8s Secret type kubernetes.io/opaque
  • Mount dans pod Trino coordinator : /etc/security/keytabs/<catalog>.keytab
  • krb5.conf via ConfigMap pointant vers KDC client
  • hive.metastore.authentication.type=KERBEROS + hive.hdfs.authentication.type=KERBEROS
  • hive.metastore.service.principal=hive/_HOST@<REALM>
  • hive.hdfs.impersonation.enabled=true pour forwarding Trino user
  • Test : kinit -kt <keytab> <principal> + klist en pre-flight

OPA auto-rules

Template Rego par rôle et catalog :

# Auto-generated by catalog-manager for catalog "client-pg-01"
package akko.trino_access

allow_catalog[name] if {
    name := "client-pg-01"
    input.user.groups[_] in ["akko-admin", "akko-engineer", "akko-analyst"]
    input.action.operation in read_ops
}

Le sidecar OPA watch le ConfigMap akko-opa-catalogs et recharge <5s.

OpenMetadata auto-ingest

À la création, appel API OpenMetadata :

POST /api/v1/services/databaseServices
POST /api/v1/services/ingest   # triggers immediate metadata sync

Dashboard Grafana (migré VictoriaMetrics) "Catalog Health" : - # catalogs actifs - latence query per catalog (trino_catalog_query_duration_seconds) - # queries per hour per catalog - connection failures

Plan d'implémentation (Sprint 41, 2 semaines)

# Stream Durée
41A Trino 480 + dynamic catalog activé 1j (✅ déjà fait 2026-04-19)
41B Backend catalog-manager FastAPI (CRUD) 3j
41C Vault / ExternalSecrets integration 2j
41D UI cockpit Admin → Catalogs 3j
41E OPA auto-rules sidecar 2j
41F OpenMetadata auto-ingest trigger 1j
41G Connector PostgreSQL + climascore test 1j
41H Connector Hive+HDFS+Kerberos 3j
41I Connectors cloud (Snowflake/BQ/Redshift/Databricks) 2j
41J Dashboard Grafana/VictoriaMetrics "Catalog Health" 1j
41K Tests Playwright E2E + integration 2j
41L Docs bilingue connect-{postgresql,hive-hdfs,cloud} 2j

Impact

  • Commercialisation : feature first-class Starburst-level
  • Démos : climascore = premier client simulé qui utilise ce flux
  • Clients legacy : HDFS+Hive+Kerberos supporté (Cloudera CDP 7.1.9)
  • Time-to-value client : < 5 min pour brancher une base

Références

  • Trino 480 release notes : https://trino.io/docs/current/release/release-480.html
  • Trino dynamic catalog : https://trino.io/docs/current/admin/properties-catalog.html
  • Starburst feature parity : https://docs.starburst.io/

Statut

Accepté 2026-04-19 — Phase 1 (Trino 480 + dynamic config) livrée. Reste Sprint 41 (backend + UI + OPA auto + OM ingest + connectors + docs).