feat: add manual db migration job with script support - #168
Open
inaki321 wants to merge 2 commits into
Open
Conversation
Contributor
|
I’m not sure this is the most ideal approach for running a SQL dump. Typically, this is something you’d want to perform only once, while a job might execute it multiple times if not carefully configured. As an alternative, you could use kubectl cp to copy the required data into the pod and kubectl exec to apply the dump to the database. I’m assuming this process would usually be done just once. That said, this proposal could still be incorporated — I just wanted to share this perspective, as it might not be the most appropriate use case for a job in this context. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What kind of change does this PR introduce?
Feature
What is the current behavior?
Database initialization and migrations currently rely on ConfigMaps to inject SQL scripts.
Limitation: Kubernetes ConfigMaps are capped at 1MB.
Issue: This prevents users from performing large data migrations or restoring significant database dumps during the deployment process.
What is the new behavior?
Scripting: Instead of being restricted by etcd's size limits, the job can pull large .sql files directly from external storage (like AWS S3, Azure Storage, volumes etc).
Flexibility: Users can now define a custom scripts block to orchestrate the migration (e.g., downloading the dump, running pre-migration checks, and executing psql).
Backward Compatibility: The existing ConfigMap-based initialization remains untouched for small, schema-only setups.
Additional context
Production Migrations: Moving data between environments.
Initial Seeding: Populating the Supabase instance with large datasets that exceed the 1MB limit.
Example of migration job enabled