This is an example of application deployement with liquibase as initContainers on kubernetes cluster.
Its essential to deploy liquibase as initContainers, in order to make sure kubernetes does not kill the process, and that the process has its all prerequisite database changes.
steps:
- install kubernetes (minikube kubectl)
- deploy postgres : kubectl apply -f postgresql-deployment.yaml
- deploy changelogs: kubectl apply -f liquibase-changelog-v1.yaml.
-
kubectl apply -f liquibase-changelog-v2.yaml
- deploy application with liquibase as initContainers: kubectl apply -f init_container_pod.yaml (as of now, need to change manually the changelog version 1/2) scripts:
delete the sample table, people and liquibase tables: DATABASECHANGELOG and DATABASECHANGELOGLOCK.
select from people table and liquibase tables: DATABASECHANGELOG and DATABASECHANGELOGLOCK.
WIP:
- support multiple changelog files (includeAll)
- rollback
- use secret password ddd