MATIH Platform is in active MVP development. Documentation reflects current implementation status.
18. CI/CD & Build System
Stage 05: Infrastructure

Stage 05: Infrastructure Deployment

Stage 05 deploys the core infrastructure services (databases, caches, message brokers) into Kubernetes. It is split into two sub-stages for independent control plane and data plane infrastructure.

Source files: scripts/stages/05a-control-plane-infrastructure.sh, scripts/stages/05b-data-plane-infrastructure.sh


Sub-Stages

05a: Control Plane Infrastructure

Deploys into matih-control-plane and matih-system namespaces:

ComponentChartPurpose
PostgreSQL (CP)Bitnami postgresqlControl plane database
Redis (CP)Bitnami redisSession cache, rate limiting
KafkaBitnami kafkaEvent streaming

05b: Data Plane Infrastructure

Deploys into matih-data-plane namespace:

ComponentChartPurpose
PostgreSQL (DP)Bitnami postgresqlData plane metadata store
Redis (DP)Bitnami redisQuery caching, LLM cache
Kafka (DP)Bitnami kafkaAgent event streaming
MinIOMinIO operatorObject storage (dev only)

Helm Deployment Pattern

All infrastructure uses helm upgrade --install for idempotency:

helm upgrade --install postgresql-control-plane bitnami/postgresql \
    --namespace matih-control-plane \
    --values infrastructure/helm/matih-control-plane/postgresql-values.yaml \
    --values infrastructure/helm/matih-control-plane/postgresql-values-dev.yaml \
    --wait --timeout 10m

Secret Management

Database credentials are managed through Kubernetes secrets, never hardcoded:

# values-dev.yaml (correct pattern)
auth:
  existingSecret: postgresql-credentials
  secretKeys:
    adminPasswordKey: postgres-password
    userPasswordKey: password

Dependencies

  • 05a requires: 00-terraform (cloud resources must exist)
  • 05b requires: 00-terraform
  • Both required by: 06-ingress-controller

Dependency Verification

# 05a: Check control plane PostgreSQL
kubectl get statefulset -n matih-control-plane postgresql-control-plane
 
# 05b: Check data plane PostgreSQL
kubectl get statefulset -n matih-data-plane postgresql-data-plane