Add optional postgres 18 upgrade to chart #1431
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ Feature / Enhancement PR
🚀 Summary (1-2 sentences)
What does this PR add or change?
Adds optional sections to helm chart along with necessary jobs to the templates folder to accomplish a postgres 17 to 18 upgrade on a live database.
By default, the upgrade is disabled.
🧪 Checks
make lintpassesmake testpasses📓 Notes (optional)
Design sketch, screenshots, or extra context.
Upgrade process from docs/docs/postgres-upgrade-process.md below.
This guide explains how to upgrade PostgreSQL from version 17 to 18 in the MCP Context Forge Helm chart with automated backup and restore to MinIO.
Prerequisites
Before proceeding with the upgrade, ensure:
kubectlandhelmaccess to your clusterUpgrade Process
The upgrade process occurs in stages and requires two separate Helm operations:
Stage 1: Enable MinIO for Backup Storage
First, you need to ensure MinIO is deployed and running to store the database backup:
# Update your my-values.yaml to enable MinIO helm upgrade --install mcp-stack ./charts/mcp-stack \ --namespace mcp \ --create-namespace \ -f my-values.yaml \ --wait --timeout 30mOr directly set MinIO to enabled:
Stage 2: Perform the PostgreSQL Upgrade with Backup
Once MinIO is running, proceed with the actual PostgreSQL upgrade:
This will:
Stage 3: Verify the Upgrade
After the upgrade completes, verify that everything is working:
Rollback Process
If something goes wrong and you need to rollback:
postgres.upgrade.enabled: falseandpostgres.upgrade.targetVersion: "17"in your values filehelm upgradewith the changesTroubleshooting
Backup Job Fails
If the backup job fails, check the logs:
PostgreSQL Pod Stuck in CrashLoopBackOff
This usually indicates the data directory compatibility issue. Make sure:
MinIO Not Starting
Ensure your storage class settings match existing PVCs:
Configuration Reference
Upgrade Parameters
postgres.upgrade.enabledfalsepostgres.upgrade.targetVersion"18"postgres.upgrade.backupCompletedfalseminio.enabledtrue(recommended for upgrades)Storage Configuration
When upgrading with existing PVCs, make sure to maintain the same storage class:
Important Notes
Cleanup After Successful Upgrade
Once you've verified the upgrade was successful:
postgres.upgrade.backupCompleted: trueto prevent the backup job from running in future upgrades