Seed of micro-service for rapid development.
Scope:
* Spring with Kotlin with FP
* No seprate Spring JPA repository per type of entity (single repository for all entities)
* QueryDsl for data access
* BDD tests (Groovy + Spock)
* DevOps with rolling updated, failure recovery, rollbacks & auto-scaling capability (Kubernetes + AWS BeanStalk supported)
* DB with auto-scaling capability (CockroachDB supported for Kubernetes)
- Build project
./build.sh
- Build and push docker image
./docker_build.sh
and then
./docker_publish.sh <version>
For demo purposes CockroachDB has been used as default SQL DB.
- Create CockroachDB service
kubectl create -f ext/cockroachdb/statefulset.yaml
or
kubectl create -f ext/cockroachdb/statefulset-secure.yaml
- Login locally from console
kubectl run -it --rm cockroach-client --image=cockroachdb/cockroach --restart=Never --command -- ./cockroach sql --url="postgresql://cockroachdb:26257/seed-microservice-kotlin?sslmode=disable"
- Administration panel
./db_proxy.sh
and then open http://localhost:8081
in your browser
DevOps for following clouds/orchestration solution is prepared:
* Kubernetes (`devops/kubernetes`)
* AWS - Elastic Beanstalk (`devops/aws`)
Simple performance tests can be done using vegeta
tool.
Check perf
directory for more details.
Pre-requisites:
* [minikube](https://github.com/kubernetes/minikube)
* Maven
* Java 8
* Running SQL DB (see DB section)
* Created DB `seed-microservice-kotlin` and access to granted to your user
- Check URL of CockroachDB
minikube service cockroachdb-public --url
and apply it to application.yaml
config file.
- Run locally
./run.sh