Reference applications for deploying microservice-based applications onto IBM Bluemix, leveraging the Netflix OSS framework.
This application has been developed and designed to run in the IBM Bluemix us-south public region. Changes may be required if it is to run on a different IBM Bluemix public region or on a local/dedicated environment.
The application is a simple dinner menu that displays available appetizers, entrees, and desserts for a non-existent restaurant. There are several components of this architecture:
- Menu UI & Backend services aggregate all the options and display them to the user
- Individual microservices for menu options among Appetizers, Entrees, and Desserts
- Menu microservices communicate to each other using the Netflix OSS Framework:
- Menu microservices can be dynamically configured using the Spring Framework:
- Spring Cloud Config provides server and client-side support for externalized configuration in a distributed system.
This project runs itself like a microservice project, as such each component in the architecture has its own Git Repository and tutorial listed below.
Infrastructure Components:
- Eureka - Contains the Eureka application components for microservices foundation
- Zuul - Contains the Zuul application components for microservices foundation
- Config - Contains the Config application components
Application Components:
- Menu UI - User interface for presenting menu options externally
- Menu Backend - Exposes all the meal components as a single REST API endpoint, aggregating Appetizers, Entrees, and Desserts.
- Appetizer Service - Microservice providing a REST API for Appetizer options
- Entree Service - Microservice providing a REST API for Entree options
- Dessert Service - Microservice providing a REST API for Dessert options
Resiliency Components:
- Hystrix - Contains the Hystrix Dashboard container version application component for microservices foundation
- Hystrix CF - Contains the Hystrix Dashboard Cloud Foundry version application component for microservices foundation
- Turbine - Contains the Turbine application component for microservices foundation
DevOps Components:
- CF Toolchain - A one click full deployment process which will create a toolchain for the Cloud Foundry version of this architecture
- IC Toolchain - A one click full deployment process which will create a toolchain for the IBM Bluemix Containers version of this architecture
- master - This is the active development branch with the latest code and integrations.
- BUILD - This is the Milestone 1 branch. It contains base microservice code, Eureka, Zuul, and Config Server components.
- DEVOPS - This is the Milestone 2 branch. It contains DevOps pipelines for easy deployment to Bluemix, as well as Active Deploy integration scenarios.
- RESILIENCY - This is the Milestone 3 branch. It contains integration with Netflix Hystrix for circuit breaker implementations, as well as Zipkin/OpenTracing for distributed tracing implementations.
- MANAGE - This is the (planned) Milestone 4 branch. It will contain cloud-based service management capabilities allowing for 24x7 operational excellence of microservice-based applications.
-
Install Java JDK 1.8 and ensure it is available in your PATH
-
Install Docker on Windows or Mac
-
Acquire the code
- Clone the base repository:
git clone https://github.com/ibm-cloud-architecture/refarch-cloudnative-netflix
- Clone the peer repositories using the
master
branch, which is the active development branch:./clone_peers.sh
- Or you can specify a branch when cloning the peer projects to clone and checkout a specific milestone branch. By default,
master
is selected if no parameter is supplied:./clone_peers.sh BUILD
to clone peer projects and use the BUILD branch for all projects
- Clone the base repository:
You can run the entire application locally on your laptop via Docker Compose, a container orchestration tool provided by Docker.
Run one of the following build script to build all the necessary Java projects.
-
./build-all.sh [-d]
will build all the components required runnable JARs using Gradle and optionally package them into Docker containers. -
./build-all.sh -m [-d]
will build all the components required runnable JARs using Apache Maven and optionally package them into Docker containers.
Run one of the following Docker Compose commands to start all the application components locally:
docker-compose up
to run with output sent to the console (for all 7 microservices)
ordocker-compose up -d
to run in detached mode and run the containers in the background.
You can access the application after a few moments via http://localhost/whats-for-dinner
! That's easy enough!
The backing services are automatically registered with Eureka and routed to the necessary dependent microservices, upon calling the Menu service.
Run the following script to deploy all the necessary Java projects as Cloud Foundry apps.
./deploy-to-cf.sh
Run the following script to deploy all the necessary Java projects as Container Groups.
./deploy-to-ics.sh