Upgrade Guide
For the full upgrade → verify → rollback → uninstall checklist, see Maintenance Cycle.
How to upgrade STOA Platform between versions with zero downtime.
Upgrade Strategy
STOA uses rolling updates by default. The upgrade order matters:
1. CRDs (if changed)
2. Database migrations (Alembic)
3. Control Plane API
4. STOA Gateway
5. Console UI + Portal
Pre-Upgrade Checklist
- Read the release notes for breaking changes
- Back up PostgreSQL (see Backup & Recovery)
- Export the shared
stoaKeycloak realm (ADR-074) - Note current versions:
helm list -n stoa-system - Verify cluster health:
kubectl get pods -n stoa-system
Upgrade Steps
1. Update CRDs
Helm does not upgrade CRDs automatically. Apply them manually:
kubectl apply -f charts/stoa-platform/crds/
2. Run Database Migrations
If the release includes schema changes:
kubectl exec -n stoa-system deploy/control-plane-api -- \
alembic upgrade head
3. Upgrade Gateway Helm Release
charts/stoa-platform lives inside the stoa-platform/stoa checkout (no hosted Helm repository is published yet) and manages the gateway workload and CRDs; upgrade Control Plane, UIs, and Keycloak via your GitOps/deployment manifests alongside it:
helm upgrade stoa-platform ./charts/stoa-platform \
-n stoa-system \
-f my-values.yaml
4. Verify
# Check pod status
kubectl get pods -n stoa-system
# Verify versions
kubectl get deploy -n stoa-system -o jsonpath='{range .items[*]}{.metadata.name}: {.spec.template.spec.containers[0].image}{"\n"}{end}'
# Health checks
curl -s https://api.<YOUR_DOMAIN>/health
curl -s https://mcp.<YOUR_DOMAIN>/health
Rolling Back
Prefer the ordered checklist in Maintenance Cycle §5. Summary:
Helm Rollback
# List history
helm history stoa-platform -n stoa-system
# Rollback to previous revision
helm rollback stoa-platform <REVISION> -n stoa-system
kubectl rollout status deploy -n stoa-system --timeout=5m
Re-run the post-upgrade verification controls after rollback.
Database Rollback
alembic downgrade can destroy or reshape data. If the migration already backfilled or dropped data, restore PostgreSQL from the pre-upgrade backup instead of downgrading (Backup and Recovery, Maintenance Cycle §5.2).
Only when release notes document a safe downgrade:
kubectl exec -n stoa-system deploy/control-plane-api -- \
alembic downgrade -1
Then confirm Helm revision and application health before closing the change.
Version Compatibility
| Component | Compatibility Rule |
|---|---|
| Control Plane API | Must match database schema version |
| STOA Gateway | Compatible with CP API N and N-1 |
| Console UI | Compatible with CP API N and N-1 |
| Portal | Compatible with CP API N and N-1 |
| CRDs | Must be applied before chart upgrade |
| Keycloak | 26.x (stoa realm, ADR-074); test major upgrades in staging |
Zero-Downtime Upgrades
STOA supports zero-downtime upgrades when:
- Multiple replicas are running (
replicas >= 2) - PodDisruptionBudget is configured:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: stoa-gateway-pdb
namespace: stoa-system
spec:
minAvailable: 1
selector:
matchLabels:
app: stoa-gateway
- Readiness probes are configured (default in Helm chart)
- Database migrations are backwards-compatible (additive only)
Related
- Configuration sources -- Change a Helm value without fighting a second manifest
- Maintenance Cycle -- Verifiable upgrade / rollback / uninstall controls
- Installation Guide -- Initial deployment
- Backup & Recovery -- Pre-upgrade backups
- Changelog -- Release notes