Giter VIP home page Giter VIP logo

epam-spring-cloud-kubernetes-2021's Introduction

Spring Cloud goes Cloud

This repository contains examples for the talk "Spring Cloud goes Cloud". The main focus of the talk is on running the Spring Boot applications using Docker and Kubernetes.

Available modules

  • config-server - Spring Cloud Config Server
  • discovery-service - Service discovery with Eureka
  • examinator - entry point, transparently sends requests to subsequent challenge providers
  • history - provides challenges about history
  • mathematic - provides challenges about math

Requesting data

To request data you need to send POST request to the examinator's /exams/exam endpoint with the following payload:

{
  "MATH": 1,
  "HISTORY": 1
}

Internally, examinator application will request data from math and history providers.

Building apps

To build the apps you can use Apache Maven because all the apps are using it. However, the build-scripts directory contains a few more scripts which build app differently.

  • build-images-naive.sh - this script runs mvn clean package and next uses simple and naive Dockerfile to build Docker images.
  • build-images-oci.sh - this script builds Docker images with Spring Boot Maven plugin and buildpacks.
  • build-images-layered.sh - this script builds far-jar's and next unpacks them using Spring Boot layered jar. As soon as jar files are unpacked, they are next used to build layered Docker images manually via another Dockerfile.
  • build-images-kubernetes.sh - this script builds jar files with with-kubernetes profile active. This profile is important for the math provider - enables reload of configs from ConfigMaps.

Running apps

Built images can be used to run apps in different ways. See the build-scripts/compose and build-scripts/kubernetes folders.

  • compose/naive - running all the images built by build-images-naive.sh script, uses health checks to wait till containers are started.
  • compose/oci - runs all the containers based on images built by build-images-oci.sh script. As a result no way to check the health here.
  • componse/docker-only - runs all the containers but without service discovery because this functionality is provided by Docker out of the box.
  • kubernetes/config-server - a few scripts which run pods and services in Kubernetes.
  • kubernetes/config-maps - running apps generated by build-images-kubernetes.sh and so that reloading of ConfigMaps are available.
  • kubernetes/autoscaling - the same but with autoscaling based on the CPU usage.

Additional metrics

The examinator app exposes liveness and readiness probes as well as a custom PhaseOfTheMoonHealthIndicator. Additionally, mathematics exposes MetricsConfiguration and metrics internally.

epam-spring-cloud-kubernetes-2021's People

Contributors

aabarmin 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.