How to properly initialize DB container in Kubernetes

10/24/2019

I will have one container in registry with the app. Then I would like to start DB container and somehow init the DB with scripts.

How to fit kubernetes jobs and init containers in my flow. Given my init container will somehow invoke flyway update, which of course needs to run only if the DB is ready. I am also not sure about the placement of the scripts itself(I don't want to refer any hostpath) and how to choose the set that should be invoked(i.e. only create test data for development).

Is it overcomplicated to create only one kubernetes files for all environment with such setup(DEV, FAT, PROD)?

-- Zveratko
database
flyway
kubernetes

0 Answers