Phase 3: MaaS Platform Infrastructure
Deploy the PostgreSQL database required by the MaaS API for key lifecycle management.
All file paths and oc apply commands in this guide are relative to the CAI-Field-Manual-MaaS repository root. Make sure you have cloned it and are working from its root directory (see Getting Started).
Prerequisites
- Phase 2 (platform configuration) is completed
- Kuadrant, User Workload Monitoring, GatewayClass, and Gateway are configured
redhat-ods-applicationsnamespace exists (created by the RHOAI operator in Phase 1)
Overview
The MaaS platform requires a PostgreSQL database before the RHOAI operator can fully enable Models-as-a-Service. Deploying PostgreSQL and creating the maas-db-config secret before enabling modelsAsService in the DataScienceCluster (Phase 4) ensures the maas-api deployment starts without crash-looping.
- PostgreSQL database - stores API key metadata (hashed tokens, subscription bindings, expiration, revocation state).
- PostgreSQL secrets -
postgres-creds(DB credentials) andmaas-db-config(connection URL consumed by maas-api).
If you prefer the fully automated path, see Automated Setup. To run only this phase automatically: ./scripts/setup-maas.sh --from-phase 3
Manual setup
Step 1: Create PostgreSQL secrets
These secrets cannot be stored in git. Create them imperatively:
On RHOAI 3.5+, the maas-api deployment runs in redhat-ai-gateway-infra, and the maas-db-config secret must also exist in that namespace. The namespace is only created by the RHOAI operator in Phase 4, so pre-create it now (this is safe - the operator adopts it later) and create the mirrored secret. Use the fully-qualified service hostname postgres.redhat-ods-applications.svc:5432 in the DB_CONNECTION_URL instead of the short name postgres:5432 (which won’t resolve from a different namespace):
The setup-maas.sh script handles this mirroring automatically.
Step 2: Deploy PostgreSQL
Apply the PostgreSQL manifests using Kustomize:
Or apply individually:
Verify
PostgreSQL
PostgreSQL secrets
Gateway
What this creates
| Resource | Namespace | Purpose |
|---|---|---|
PVC/postgres-data | redhat-ods-applications | 20Gi storage for PostgreSQL data |
Service/postgres | redhat-ods-applications | ClusterIP service for PostgreSQL |
Deployment/postgres | redhat-ods-applications | PostgreSQL 16 instance (RHEL 9 based) |
Secret/postgres-creds | redhat-ods-applications | DB user, password, database name (imperative) |
Secret/maas-db-config | redhat-ods-applications | Connection URL for maas-api (imperative) |
Troubleshooting
PostgreSQL pod not starting
Common causes:
postgres-credssecret does not exist (create it per Step 1)- PVC cannot be bound (check StorageClass availability)
Gateway stuck in Pending
On baremetal/OpenStack clusters without a cloud LB controller:
- See
openshift-gateway-setup/for MetalLB configuration - On cloud clusters, the LB provisions automatically
Appendix
Directory Structure
References
Next step
Proceed to Phase 4: RHOAI Configuration.