HaJunYoo opened a new issue, #9013:
URL: https://github.com/apache/gravitino/issues/9013
### Describe the feature
When deploying Gravitino with the official 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 deployment while using helm
chart.
- Error-prone process that can lead to deployment failures
- Poor user experience for Kubernetes deployments
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**
1. Job Resource
- Create a new Job template in
helm-chart/templates/gravitino-db-init-job.yaml
2. 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.
```yaml
# for example
entity:
store:
jdbc:
initializeSchema:
enabled: true # Enable/disable the init job
image:
repository: postgres
tag: 16-alpine
```
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]