MATIH Platform is in active MVP development. Documentation reflects current implementation status.
17. Kubernetes & Helm
Namespaces
Ingress

Ingress Namespace

The matih-ingress namespace hosts the NGINX Ingress Controller that routes external traffic to platform services. For multi-tenant production deployments, per-tenant ingress controllers are deployed in their respective tenant namespaces.


Platform Ingress Controller

The central NGINX Ingress Controller handles all platform API traffic:

# Deployed in matih-ingress namespace
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress-nginx-controller
  namespace: matih-ingress
spec:
  replicas: 2
  template:
    spec:
      containers:
        - name: controller
          image: registry.k8s.io/ingress-nginx/controller:v1.9.6
          ports:
            - containerPort: 80
              name: http
            - containerPort: 443
              name: https

Ingress Routing Rules

API traffic is routed to backend services based on path prefixes:

PathBackend ServiceNamespacePort
/api/v1/authiam-servicematih-control-plane8080
/api/v1/tenantstenant-servicematih-control-plane8080
/api/v1/configconfig-servicematih-control-plane8080
/api/v1/auditaudit-servicematih-control-plane8080
/api/v1/aiai-servicematih-data-plane8000
/api/v1/queryquery-enginematih-data-plane8080
/api/v1/catalogcatalog-servicematih-data-plane8086
/api/v1/bibi-servicematih-data-plane8084

Ingress Annotations

MATIH services use standard NGINX Ingress annotations:

# From ai-service ingress configuration
annotations:
  nginx.ingress.kubernetes.io/proxy-body-size: "50m"
  nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
  nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
  nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
  nginx.ingress.kubernetes.io/proxy-buffering: "off"
  # WebSocket support for AI streaming
  nginx.ingress.kubernetes.io/websocket-services: "ai-service"

For the data plane umbrella chart:

# From matih-data-plane ingress
annotations:
  nginx.ingress.kubernetes.io/proxy-body-size: "100m"
  nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
  nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
  nginx.ingress.kubernetes.io/proxy-buffer-size: "128k"

TLS Termination

TLS is terminated at the ingress controller using cert-manager issued certificates:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod-dns01"
spec:
  tls:
    - hosts:
        - api.matih.ai
      secretName: api-matih-ai-tls
  rules:
    - host: api.matih.ai
      http:
        paths:
          - path: /api/v1/ai
            pathType: Prefix
            backend:
              service:
                name: ai-service
                port:
                  number: 8000

Per-Tenant Ingress

Each tenant receives a dedicated ingress controller when the tenant tier supports it:

# From infrastructure/helm/ingress-nginx/values-tenant.yaml
controller:
  ingressClassResource:
    name: "nginx-tenant-${TENANT_SLUG}"
    controllerValue: "k8s.io/ingress-nginx-tenant-${TENANT_SLUG}"
  service:
    type: LoadBalancer
  replicaCount: 2

This provides complete traffic isolation between tenants at the network level.