[FEATURE] Add Helm Job to automate DB schema initialization for external databases
Describe the feature
When deploying Gravitino with the Helm chart using an external database (PostgreSQL or MySQL), users must manually initialize the database schema by connecting to the database and executing the appropriate schema-x.x.x-[db].sql script before starting the server.
This manual step is inconvenient, error-prone, and conflicts with the automated deployment experience users expect from Helm charts.
Suggests adding a Helm Job to automate database schema initialization.
Motivation
Current Pain Points
- Manual database initialization is required for external database connection while using helm chart.
- This kinds of error-prone process that can lead to deployment failures
Benefits of This Improvement
- Reduces deployment friction and potential errors
Describe the solution
Add a Helm Job that runs as a pre-install and pre-upgrade hook to automatically initialize the entity store schema.
Implementation Details
- Job Resource
- Create a new Job template in helm-chart/templates/gravitino-db-init-job.yaml
- Container Configuration
- Use lightweight database client images like postgres:16-alpine, mysql:8-client
- Mount SQL scripts from the /scripts directory
- Use db credentials from values.yaml
values.yaml will be as below.
# for example
entity:
store:
jdbc:
initializeSchema:
enabled: true # Enable/disable the init job
image:
repository: postgres
tag: 16-alpine
Additional context
No response
Hi I would like to work on implementing this feature. Please assign me in this issue.