Skip to main content

Upgrades

This guide covers the em-runtime Helm chart upgrade process, version promotion through environments, migration procedures, and rollback strategies.

Upgrade Procedures

Standard Helm Upgrade

For direct Helm deployments (not using ArgoCD):

Pre-Upgrade Checklist

Always back up PostgreSQL, Redis, and the em-runtime-secrets Secret before upgrading.
Before upgrading:
  1. Review the changelog for breaking changes and required migrations
  2. Back up databases:
  3. Verify current health:
  4. Test in non-production first — promote through dev and staging before production

Database Migrations

EM-Runtime services run Alembic database migrations automatically on startup. Each service manages its own database migrations independently.

Migration Behavior

AspectBehavior
TriggerAutomatic on pod startup
DirectionForward only (upgrade)
ScopePer-service, per-database
SafetyIdempotent — safe to run multiple times

Migration Order

Migrations are applied in service startup order:
If a migration fails, the pod will restart and retry. Check pod logs for migration errors before investigating further.

Rollback

Helm Rollback

Database Rollback Considerations

Alembic migrations are forward-only in production. If a database migration must be reversed, you must restore from backup.
  • Schema-only changes (add column, add table): Generally safe to keep during rollback; old code ignores new columns
  • Data migrations: Require database restore from pre-upgrade backup
  • Destructive migrations (drop column, rename): Require database restore

Direct Helm

Always specify --version in production:

Upgrade Troubleshooting

Check pod logs for migration errors:
Common causes:
  • Database migration conflict (two migrations with same parent)
  • Missing database or extension
  • Incompatible secret format
Init containers wait for dependencies (PostgreSQL, Redis, Keycloak). Check that all infrastructure services are healthy:
Verify that hostname and scheme values match your Gateway and DNS configuration:
The CMP plugin may need to rebuild the chart dependency. Force a sync:

Next Steps

Values Reference

Complete reference for all Helm chart values.