Init script creates database for app without manual actions required.
If I’m right, when creating a new PXC cluster all yamls can be applied in one go, if app user/database-name/password would be in deploy/secrets.yaml and these details picked up to:
CREATE DATABASE app;
CREATE USER …
GRANT ALL ON …
FLUSH PRIVILEGES;
… and app should be able to start using a new DB without manual steps
(just interested to think on what is missing to get a cluster in one button click)
Obviously, this can be easily done in an additional container, if this automation is not offered for now.
Hi @Laimis
If you need to init something bigger than empty the database - you can start a new cluster, manually put all required schemas and data and make a backup after all.
The next time when you need to create a new instance of the database with the same data - you can recover from backup immediately after empty cluster creation.