Skip to content

IN PROGRESS: Step 8. Using java spring-boot reactive webflux rsocket r2dbc docker compose docker swarm and k8s kubernetes https://daggerok.github.io/from-zero-to-reactive-cloud-micro-hero/

License

Notifications You must be signed in to change notification settings

daggerok/from-zero-to-reactive-cloud-micro-hero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

from zero to reactive cloud micro hero Build Status

Using java spring-boot reactive webflux r2dbc docker compose docker swarm and k8s kubernetes

Status

IN PROGRESS

  • Configured Travis CI pipelines
  • Initialized draft and implement of VuePress documentation
  • Implemented step1 with sets of spring boot 2.2.o.RELEASE reactive applications
  • Implemented step2 with replacing in-memory map DBs -> r2dbc-postgres spring-data integration (run pg in docker)
  • Implemented step3 and Dockerize all applications using fabric8.io maven plugin
  • Implemented step4 and Dockerize multi-module application using fabric8.io maven plugin (all in one)
  • Implemented step5 with docker-compose maven plugin
  • Implemented step6 and Dockerize all applications using jib maven plugin from Google
  • Implemented step7 with docker-swarm
  • Implemented step8 with k8s and skaffold
  • Implemented step9 with k8s and helm-chart
  • Implemented stepX with project riff

Step 1

Simple sets of applications implementation for local run

./mvnw -DskipTests

java -jar step1-speakers-rest-api-service/target/*.jar
java -jar step1-sessions-rsocket-service/target/*.jar
java -jar step1-frontend/target/*.jar

#http :8082/speakers name=max
#http :8082/speakers name=bax
#http :8082/speakers
http :8080

Step 2

Simple sets of r2dbc applications with postgres (in docker)

#./mvnw -pl :step2-docker docker:start
docker stop pg || true ; docker run --rm --name pg -p 5432:5432 postgres:alpine

./mvnw

java -jar step2-speakers-rest-api-service/target/*.jar
java -jar step2-sessions-rsocket-service/target/*.jar
java -jar step2-frontend/target/*.jar

#http :8084/sessions name=maximum speakers=max
#http :8084/sessions

#http :8085/speakers name=max
#http :8085/speakers

http :8083

#./mvnw -pl :step2-docker docker:stop
docker rm -f -v pg

Step 3

An applications in docker using fabric8.io maven plugin

./mvnw -pl :step3-postgres-fabric8 docker:build docker:start
./mvnw -pl :step3-sessions-rsocket-service-fabric8,:step3-speakers-rest-api-service-fabric8,:step3-frontend-fabric8 clean package docker:build docker:start

#http :8087/sessions name=maximum speakers=max
#http :8088/speakers name=max
http :8086

./mvnw -pl :step3-speakers-rest-api-service-fabric8,:step3-sessions-rsocket-service-fabric8,:step3-frontend-fabric8 docker:stop docker:remove
./mvnw -f step3-postgres-fabric8/ docker:stop docker:remove

Step 4

Dockerized multi-module application using fabric8.io maven plugin (all in one)

./mvnw -f step4-all-in-one-fabric8 clean package -DskipTests
./mvnw -f step4-all-in-one-fabric8 -pl :step4-all-in-one-fabric8 docker:build docker:start

#http :8090/sessions name=maximum speakers=max
#http :8091/speakers name=max
http :8089

./mvnw -f step4-all-in-one-fabric8 -pl :step4-all-in-one-fabric8 docker:stop docker:remove

Step 5

Dockerized multi-module application using docker-compose maven plugin (all in one)

./mvnw -f step5-all-in-one-docker-compose -pl :step5-all-in-one-docker-compose docker:build docker:start
./mvnw -f step5-all-in-one-docker-compose
./mvnw -f step5-all-in-one-docker-compose -pl :step5-all-in-one-docker-compose docker:stop docker:remove

#./mvnw -pl :step5-all-in-one-docker-compose docker-compose:up

#http :8093/sessions name=maximum speakers=max
#http :8094/speakers name=max
http :8092

./mvnw -pl :step5-all-in-one-docker-compose docker-compose:down

Step 6

Dockerized multi-module application using jib maven plugin from Google and docker-compose maven plugin (all in one)

./mvnw -pl :step6-all-in-one-google-jib -P pg-start
./mvnw -f step6-all-in-one-google-jib compile jib:dockerBuild
./mvnw -pl :step6-all-in-one-google-jib -P pg-stop

./mvnw -pl :step6-all-in-one-google-jib -P compose-create
./mvnw -pl :step6-all-in-one-google-jib -P compose-up

#http :8096/sessions name=maximum speakers=max
#http :8097/speakers name=max
http :8095

./mvnw -pl :step6-all-in-one-google-jib -P compose-down

Step 7

Dockerized multi-module application using docker-swarm (all in one)

prepare docker-swarm

docker swarm init
docker service create --name registry --publish published=5000,target=5000 registry:2

run test postgres container for success tests during build

./mvnw -pl :step7-all-in-one-docker-swarm -P pg-start
./mvnw -f step7-all-in-one-docker-swarm compile jib:build
./mvnw -pl :step7-all-in-one-docker-swarm -P pg-stop

test with docker-compose

./mvnw -pl :step7-all-in-one-docker-swarm -P compose-create
./mvnw -pl :step7-all-in-one-docker-swarm -P compose-up

#http :8099/sessions name=maximum speakers=max
#http :8100/speakers name=max
http :8098

./mvnw -pl :step7-all-in-one-docker-swarm -P compose-down

docker stack deploy

docker stack deploy -c step7-all-in-one-docker-swarm/docker-compose.yml step7

#http :8100/speakers name=max                  | jq '.'
#http :8099/sessions name=maximum speakers=max | jq '.'
http :8098

docker stack rm step7
docker service rm registry
docker swarm leave -f

Version

./mvnw build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false

Cleanup

#docker rm -f -v `docker ps -aq`
for i in $(docker ps -aq) ; do docker rm -f -v $i ; done

#docker rmi -f `docker images -q --filter=dangling=true`
for i in $(docker images -q --filter=dangling=true) ; do docker rmi -f $i ; done

#docker rmi -f `docker images -q -f=reference='*/*step*'`
for i in $(docker images -q -f=reference='*/*step*') ; do docker rmi -f $i ; done

GitHub Pages

Documentation is located here

Resources

For further reference, please consider the following sections:

About

IN PROGRESS: Step 8. Using java spring-boot reactive webflux rsocket r2dbc docker compose docker swarm and k8s kubernetes https://daggerok.github.io/from-zero-to-reactive-cloud-micro-hero/

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published