Cleanup & Teardown
Remove Models as a Service and its dependencies from your OpenShift cluster.
Automated Cleanup
The cleanup script undoes setup-maas.sh in reverse order, checking whether each resource exists before deleting.
The script prompts for confirmation before deleting anything. Pass --yes to skip the prompt.
Options
| Flag | Description |
|---|---|
--dry-run | Preview what would be deleted without actually deleting |
--keep-operators | Skip operator removal (Phase 7) - useful when you only want to tear down models and config |
--from-phase <N> | Start from a specific cleanup phase (1-7) |
--yes | Skip the confirmation prompt |
Cleanup Phases
The script runs these phases in order:
| Phase | Name | What it removes |
|---|---|---|
| 1 | External Models | ExternalModel CRs, provider API key secrets, external-models namespace |
| 2 | Observability | Telemetry policies, COO / OpenTelemetry / Tempo operators and namespaces |
| 3 | Models | MaaSSubscription, MaaSAuthPolicy, MaaSModelRef, LLMInferenceService, llm namespace |
| 4 | Red Hat OpenShift AI Configuration | OdhDashboardConfig, DataScienceCluster, DSCInitialization |
| 5 | MaaS Platform | PostgreSQL deployment / PVC / service, postgres-creds and maas-db-config secrets |
| 6 | Platform Configuration | Gateway, GatewayClass, Route, Kuadrant CR, user workload monitoring config, MetalLB (if installed) |
| 7 | Operators | RHCL, cert-manager, LWS, Red Hat OpenShift AI subscriptions / CSVs, operator namespaces, Red Hat OpenShift AI-managed namespaces |
Examples
Preview what would be deleted:
Remove models and config but keep operators installed:
Remove only the operators (everything else already cleaned up):
Manual Cleanup
If you prefer to remove resources selectively, follow these steps in order.
Remove Models
Remove RHOAI Configuration
Remove MaaS Platform (PostgreSQL)
Remove Gateway and Kuadrant
Remove Operators
Delete subscriptions first, then CSVs, then namespaces:
Wait 60 seconds for the RHOAI operator to clean up managed resources, then remove its namespaces:
What Is Not Removed
The cleanup script does not remove:
- Pre-existing namespaces (
openshift-operators,openshift-monitoring,openshift-ingress) - GPU operators (NFD, NVIDIA GPU Operator) - these are installed separately
- CRDs left behind by operators (OLM does not remove CRDs on operator deletion)
- Persistent data in external storage (e.g., if you used an external PostgreSQL)
Next step
To reinstall, run ./scripts/setup-maas.sh - see Automated Setup.