{"id":19656748,"url":"https://github.com/daggerok/from-zero-to-reactive-cloud-micro-hero","last_synced_at":"2025-04-28T18:32:53.031Z","repository":{"id":151041666,"uuid":"215857139","full_name":"daggerok/from-zero-to-reactive-cloud-micro-hero","owner":"daggerok","description":"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/","archived":false,"fork":false,"pushed_at":"2020-02-19T15:07:28.000Z","size":749,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T10:23:12.704Z","etag":null,"topics":["r2dbc","r2dbc-postgres","r2dbc-postgresql","spring-boot-2","spring-webflux","webflux-fallback"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daggerok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-17T18:13:42.000Z","updated_at":"2023-09-05T16:50:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbc2167f-8173-4f53-ac0b-8b8d3144aefa","html_url":"https://github.com/daggerok/from-zero-to-reactive-cloud-micro-hero","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Ffrom-zero-to-reactive-cloud-micro-hero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Ffrom-zero-to-reactive-cloud-micro-hero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Ffrom-zero-to-reactive-cloud-micro-hero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggerok%2Ffrom-zero-to-reactive-cloud-micro-hero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daggerok","download_url":"https://codeload.github.com/daggerok/from-zero-to-reactive-cloud-micro-hero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251366134,"owners_count":21578079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r2dbc","r2dbc-postgres","r2dbc-postgresql","spring-boot-2","spring-webflux","webflux-fallback"],"created_at":"2024-11-11T15:28:47.630Z","updated_at":"2025-04-28T18:32:53.019Z","avatar_url":"https://github.com/daggerok.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# from zero to reactive cloud micro hero [![Build Status](https://travis-ci.org/daggerok/from-zero-to-reactive-cloud-micro-hero.svg?branch=master)](https://travis-ci.org/daggerok/from-zero-to-reactive-cloud-micro-hero)\nUsing java spring-boot reactive webflux r2dbc docker compose docker swarm and k8s kubernetes\n\n## Status\nIN PROGRESS\n\n* ~~Configured Travis CI pipelines~~\n* ~~Initialized draft and implement of VuePress documentation~~\n* ~~Implemented step1 with sets of spring boot 2.2.o.RELEASE reactive applications~~\n* ~~Implemented step2 with replacing in-memory map DBs -\u003e r2dbc-postgres spring-data integration (run pg in docker)~~\n* ~~Implemented step3 and Dockerize all applications using fabric8.io maven plugin~~\n* ~~Implemented step4 and Dockerize multi-module application using fabric8.io maven plugin (all in one)~~\n* ~~Implemented step5 with docker-compose maven plugin~~\n* ~~Implemented step6 and Dockerize all applications using jib maven plugin from Google~~\n* ~~Implemented step7 with docker-swarm~~\n* Implemented step8 with k8s and skaffold\n* Implemented step9 with k8s and helm-chart\n* Implemented stepX with project riff\n\n## Step 1\nSimple sets of applications implementation for local run\n\n```bash\n./mvnw -DskipTests\n\njava -jar step1-speakers-rest-api-service/target/*.jar\njava -jar step1-sessions-rsocket-service/target/*.jar\njava -jar step1-frontend/target/*.jar\n\n#http :8082/speakers name=max\n#http :8082/speakers name=bax\n#http :8082/speakers\nhttp :8080\n```\n\n## Step 2\nSimple sets of r2dbc applications with postgres (in docker)\n\n```bash\n#./mvnw -pl :step2-docker docker:start\ndocker stop pg || true ; docker run --rm --name pg -p 5432:5432 postgres:alpine\n\n./mvnw\n\njava -jar step2-speakers-rest-api-service/target/*.jar\njava -jar step2-sessions-rsocket-service/target/*.jar\njava -jar step2-frontend/target/*.jar\n\n#http :8084/sessions name=maximum speakers=max\n#http :8084/sessions\n\n#http :8085/speakers name=max\n#http :8085/speakers\n\nhttp :8083\n\n#./mvnw -pl :step2-docker docker:stop\ndocker rm -f -v pg\n```\n\n## Step 3\nAn applications in docker using fabric8.io maven plugin\n\n```bash\n./mvnw -pl :step3-postgres-fabric8 docker:build docker:start\n./mvnw -pl :step3-sessions-rsocket-service-fabric8,:step3-speakers-rest-api-service-fabric8,:step3-frontend-fabric8 clean package docker:build docker:start\n\n#http :8087/sessions name=maximum speakers=max\n#http :8088/speakers name=max\nhttp :8086\n\n./mvnw -pl :step3-speakers-rest-api-service-fabric8,:step3-sessions-rsocket-service-fabric8,:step3-frontend-fabric8 docker:stop docker:remove\n./mvnw -f step3-postgres-fabric8/ docker:stop docker:remove\n```\n\n## Step 4\nDockerized multi-module application using fabric8.io maven plugin (all in one)\n\n```bash\n./mvnw -f step4-all-in-one-fabric8 clean package -DskipTests\n./mvnw -f step4-all-in-one-fabric8 -pl :step4-all-in-one-fabric8 docker:build docker:start\n\n#http :8090/sessions name=maximum speakers=max\n#http :8091/speakers name=max\nhttp :8089\n\n./mvnw -f step4-all-in-one-fabric8 -pl :step4-all-in-one-fabric8 docker:stop docker:remove\n```\n\n## Step 5\nDockerized multi-module application using docker-compose maven plugin (all in one)\n\n```bash\n./mvnw -f step5-all-in-one-docker-compose -pl :step5-all-in-one-docker-compose docker:build docker:start\n./mvnw -f step5-all-in-one-docker-compose\n./mvnw -f step5-all-in-one-docker-compose -pl :step5-all-in-one-docker-compose docker:stop docker:remove\n\n#./mvnw -pl :step5-all-in-one-docker-compose docker-compose:up\n\n#http :8093/sessions name=maximum speakers=max\n#http :8094/speakers name=max\nhttp :8092\n\n./mvnw -pl :step5-all-in-one-docker-compose docker-compose:down\n```\n\n## Step 6\nDockerized multi-module application using jib maven plugin from Google and docker-compose maven plugin (all in one)\n\n```bash\n./mvnw -pl :step6-all-in-one-google-jib -P pg-start\n./mvnw -f step6-all-in-one-google-jib compile jib:dockerBuild\n./mvnw -pl :step6-all-in-one-google-jib -P pg-stop\n\n./mvnw -pl :step6-all-in-one-google-jib -P compose-create\n./mvnw -pl :step6-all-in-one-google-jib -P compose-up\n\n#http :8096/sessions name=maximum speakers=max\n#http :8097/speakers name=max\nhttp :8095\n\n./mvnw -pl :step6-all-in-one-google-jib -P compose-down\n```\n\n## Step 7\nDockerized multi-module application using docker-swarm (all in one)\n\n_prepare docker-swarm_\n\n```bash\ndocker swarm init\ndocker service create --name registry --publish published=5000,target=5000 registry:2\n```\n\n_run test postgres container for success tests during build_\n\n```bash\n./mvnw -pl :step7-all-in-one-docker-swarm -P pg-start\n./mvnw -f step7-all-in-one-docker-swarm compile jib:build\n./mvnw -pl :step7-all-in-one-docker-swarm -P pg-stop\n```\n\n_test with docker-compose_\n\n```bash\n./mvnw -pl :step7-all-in-one-docker-swarm -P compose-create\n./mvnw -pl :step7-all-in-one-docker-swarm -P compose-up\n\n#http :8099/sessions name=maximum speakers=max\n#http :8100/speakers name=max\nhttp :8098\n\n./mvnw -pl :step7-all-in-one-docker-swarm -P compose-down\n```\n\n_docker stack deploy_\n\n```bash\ndocker stack deploy -c step7-all-in-one-docker-swarm/docker-compose.yml step7\n\n#http :8100/speakers name=max                  | jq '.'\n#http :8099/sessions name=maximum speakers=max | jq '.'\nhttp :8098\n\ndocker stack rm step7\ndocker service rm registry\ndocker swarm leave -f\n```\n\n## Version\n\n```bash\n./mvnw build-helper:parse-version versions:set -DnewVersion=\\${parsedVersion.majorVersion}.\\${parsedVersion.minorVersion}.\\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false\n```\n\n## Cleanup\n\n```bash\n#docker rm -f -v `docker ps -aq`\nfor i in $(docker ps -aq) ; do docker rm -f -v $i ; done\n\n#docker rmi -f `docker images -q --filter=dangling=true`\nfor i in $(docker images -q --filter=dangling=true) ; do docker rmi -f $i ; done\n\n#docker rmi -f `docker images -q -f=reference='*/*step*'`\nfor i in $(docker images -q -f=reference='*/*step*') ; do docker rmi -f $i ; done\n```\n\n## GitHub Pages\nDocumentation is located [here](https://daggerok.github.io/from-zero-to-reactive-cloud-micro-hero/)\n\n## Resources\nFor further reference, please consider the following sections:\n\n* [GitHub: daggerok/k8s-nginx-ingress-example](https://github.com/daggerok/k8s-nginx-ingress-example)\n* [YouTube: Kubernetes Master Class: Kubernetes from Zero to Hero](https://www.youtube.com/watch?v=srQJq1gJXRw)\n* [YouTube: k3s -- The Lightweight Kubernetes Distribution Built for the Edge](https://www.youtube.com/watch?v=WYPd7i15XOg)\n* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)\n* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.2.0.RELEASE/maven-plugin/)\n* [Spring Configuration Processor](https://docs.spring.io/spring-boot/docs/2.2.0.RELEASE/reference/htmlsingle/#configuration-metadata-annotation-processor)\n* [Thymeleaf](https://docs.spring.io/spring-boot/docs/2.2.0.RELEASE/reference/htmlsingle/#boot-features-spring-mvc-template-engines)\n* [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/)\n* [Error handling](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-ann-controller-exceptions)\n* [ServerWebExchange injection](https://github.com/spring-projects/spring-framework/issues/19857#issuecomment-453452436)\n* [R2DBC db initialization](https://github.com/spring-projects-experimental/spring-boot-r2dbc/blob/master/documentation.adoc#database-initialization)\n* [Maven + Docker by using fabric.io](https://dmp.fabric8.io/)\n* [Maven + Docker by using GoogleContainerTools/jib](GoogleContainerTools/jib) maven plugin\n* [Postgres on Docker Hub](https://hub.docker.com/_/postgres)\n* [Docker cleanup: docker images -f \"dangling=true\"](https://docs.docker.com/engine/reference/commandline/images/)\n* [docker-compose-maven-plugin](https://github.com/dkanejs/docker-compose-maven-plugin)\n* [Spring Boot Google JIB](https://github.com/GoogleContainerTools/jib/tree/master/examples/spring-boot)\n* [Google JIB FAQ](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md)\n* [jib-maven-plugin](https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin)\n* [YouTube: Speedy build for your java application images with JIB! by Mohammed Aboullaite](https://www.youtube.com/watch?v=bkC1spGOI7Y)\n* [No fat jars with jib](https://phauer.com/2019/no-fat-jar-in-docker-image/)\n* [Docker Swarm getting started guide](https://docs.docker.com/engine/swarm/stack-deploy/)\n* [Docker Swarm -\u003e k8s](https://hackernoon.com/a-kubernetes-guide-for-docker-swarm-users-c14c8aa266cc)\n* [YouTujbe: Deploying and scaling applications with Docker, Swarm, and a tiny bit of Python magic - PyCon 2016](https://www.youtube.com/watch?v=GpHMTR7P2Ms)\n* [YouTube: Deploy and scale containers with Docker native, open source orchestration PyCon 2017](https://www.youtube.com/watch?v=EuzoEaE6Cqs)\n* [Container Training](https://container.training/)\n* [k8s workshop](https://pycon2019.container.training/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggerok%2Ffrom-zero-to-reactive-cloud-micro-hero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaggerok%2Ffrom-zero-to-reactive-cloud-micro-hero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggerok%2Ffrom-zero-to-reactive-cloud-micro-hero/lists"}