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

Stage 12: Workflow Orchestration

Stage 12 deploys Apache Airflow for DAG-based pipeline orchestration. It sets up Airflow secrets (fernet key, API server key), PostgreSQL database, and deploys the Airflow Helm chart with web server, scheduler, and worker components.

Source file: scripts/stages/12-workflow-orchestration.sh


Components Deployed

ComponentPurpose
Airflow Web ServerDAG management UI and REST API
Airflow SchedulerDAG parsing and task scheduling
Airflow WorkerTask execution (CeleryExecutor or KubernetesExecutor)
Airflow TriggererDeferrable operator support
Airflow DatabasePostgreSQL (from Stage 05b)

Secret Setup

The stage creates the following secrets if they do not already exist:

SecretContentsPurpose
airflow-fernet-keyFernet encryption keyEncrypt connection passwords in Airflow metadata DB
airflow-api-server-secretRandom hex stringAPI server authentication

Fernet Key Generation

python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

Deployment

helm upgrade --install airflow apache-airflow/airflow \
    --namespace matih-data-plane \
    --values infrastructure/helm/airflow/values.yaml \
    --values infrastructure/helm/airflow/values-dev.yaml \
    --wait --timeout 15m

Database Setup

Airflow uses the PostgreSQL instance deployed in Stage 05b. The database connection is configured via the airflow-database-secret Kubernetes secret, never hardcoded in values files.


Libraries Used

LibraryPurpose
core/config.shTerraform output access
k8s/namespace.shNamespace management
helm/repo.shHelm repository management
helm/deploy.shDeployment functions
k8s/dev-secrets.shDev environment secret creation

Dependencies

  • Requires: 05b-data-plane-infrastructure, 06-ingress-controller
  • Required by: 13-data-catalogs

Dependency Verification

kubectl get pods -n matih-data-plane -l component=webserver
kubectl get pods -n matih-data-plane -l component=scheduler