项目作者: flow-lab

项目描述 :
Simple PostgreSQL migration with support for TLS connection. Use as InitContainer in Kubernetes.
高级语言: Go
项目地址: git://github.com/flow-lab/flow-k8-sql.git
创建时间: 2020-01-26T20:45:59Z
项目社区:https://github.com/flow-lab/flow-k8-sql

开源协议:

下载


FlowDBer Build and Publish on Release Tag

FlowDBer project includes a helper container that makes it easy to run SQL migration scripts using PostgreSQL on
Kubernetes. To use it, simply include it as an InitContainer in your deployment definition, following the instructions
in the Kubernetes documentation.

Check minikube.yml for example configuration.

Requirements

  • file name should be UNIXTIME-WHAT.sql, eg: 1580247785-user-table.sql or just INDEX-WHAT.sql, eg:
    0-new-user-db.sql, 1-birthdate-column-in-user.sql etc
  • sql scripts must be idempotent, which means that they can be run multiple times without causing any problems :)

Project structure

  • ./cmd - app implementation
  • ./internal - internal packages that should not be shared with other projects
  • ./github - GitHub Actions workflows
  • ./certs - certificates for TLS when running locally with docker compose
  • ./db-scripts - database scripts that will be executed on startup when using docker compose
  • docker-compose.yaml - docker compose file for running locally
  • Makefile - makefile for running commands during development
  • LICENSE - license file

Requirements

DockerHub

https://hub.docker.com/r/flowlab/flowdber

Logging

App is using dlog for logging. It is configured to log to stdout and stderr.

Running locally

You can test it locally with Minikube. Start minikube
and apply kubectl apply -f minikube.yml.

Credits