Upgrades
The operator handles Langfuse version upgrades automatically when you change spec.image.tag.
Upgrade Sequence
- Detect
image.tagchange - Set
status.phase = Migrating - Optionally trigger a CNPG backup
- Create a migration Job with the new image
- Wait for migration Job to succeed
- Rolling update Web Deployment
- Rolling update Worker Deployment
- Monitor background migrations
- Run post-upgrade health checks
- Set
status.phase = Running
Configuration
yaml
spec:
upgrade:
strategy: rolling
preUpgrade:
runMigrations: true # default: true
backupDatabase: true # trigger CNPG backup before upgrade
rollingUpdate:
maxUnavailable: 0 # default: 0
maxSurge: 1 # default: 1
postUpgrade:
runBackgroundMigrations: true # default: true
healthCheckTimeout: "120s" # default: 120s
autoRollback: true # revert on health check failureAuto-Rollback
When autoRollback is enabled and post-upgrade health checks fail within the timeout, the operator:
- Reverts Web and Worker Deployments to the previous image
- Sets the condition
UpgradeRolledBack - Emits a Kubernetes Event with details
The database migration is not rolled back automatically. PostgreSQL migrations created by Langfuse are designed to be forward-compatible.
Monitoring an Upgrade
Watch the instance status:
bash
kubectl get langfuseinstance langfuse -n langfuse -wNAME PHASE READY VERSION AGE
langfuse Migrating false 3.21.0 5d
langfuse Running true 3.22.0 5dCheck conditions for details:
bash
kubectl describe langfuseinstance langfuse -n langfuse