Giter VIP home page Giter VIP logo

ping-pong's Introduction

Microservices playing Pong

Pong

This demo brings good old Pong to a Microservices world. Hopefully everyone still remembers ;-)

The actors:

  • ping : A spring-boot player using okhttp to play against a JAX-RS service
  • pong : A wildfly-swarm opponent using JAX-RS
  • pong v2 : A spring-boot opponent using JAX-RS

The purpose of this project is to show the gradual process from converting a plain Java Microservices over Docker images to a full Kubernetes orchestration setup.

Each step is contained in a separate Git branch:

1-java: Using local Java

ping vs. pong

cd pong
mvn wildfly-swarm:run &
cd ../ping
mvn spring-boot:run

2-docker: Using Docker

ping vs. pong

mvn clean install docker:build
mvn -N -Ddocker.follow docker:start

3-kubernetes: Usin plain Kuberentes descriptors

cd pong/src/main/kubernetes
kubectl create -f rc.yaml
kubectl create -f service.yaml
cd ping/src/main/kubernetes
kubectl create -f rc.yaml

3.5-fmp:

Use the fabric8-maven-plugin to create the descriptors

cd ping
mvn fabric8:deploy
cd ../pong
mvn fabric8:deploy

4-ping-update: Rolling update the client

The client gets update to use a direct DNS SRV lookup to find its service as well changing the log output. The new image is rhuss/ping:2

cd ping/src/main/kuberentes
sh rolling-update-v2.sh
# Rollback:
sh rolling-update-v1.sh

5-pong-update: Rolling update the server

Switch the server from wildfly-swarm to spring-boot. The new image is rhuss/pong:2

cd ping/src/main/kuberentes
sh rolling-update-v2.sh
# Rollback:
sh rolling-update-v1.sh

6-elasticsearch-logging: Add elastic search logging to the app

  • New image rhuss/ping:3 which uses a fluentd logger for writing out the result to fluentd
  • Modify the ping application to a pod with the application and fluentd as a sidecar.
  • Descriptors for elasticsearch and kibana applications
mvn clean install
cd dist
mvn fabric8:resource
kubectl create -f target/classes/META-INF/fabric8/kubernetes.yml

ping-pong's People

Contributors

rhuss avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.