Skip to content

liemng/sample-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microservices

Overview

A simple microservice-based exercise using SpringBoot:

Class diagram

Requirements

  • Requires Docker, Kubernetes, Helm, Java 8, and Maven
  • At run-time, fetches configurations from Configuration Github

Build it!

mvn clean package docker:build

Deploy it!

Third-Party Infrastructure

Install MySQL:

helm install --name microdb --set mysqlRootPassword=7layer,mysqlDatabase=microservicedb stable/mysql

Install RabbitMQ (HA):

helm install --name eventing --set rabbitmqPassword=guest stable/rabbitmq-ha

Install NginX Ingress Controller:

helm install stable/nginx-ingress --name nginx --namespace kube-system --set rbac.create=true --set controller.replicaCount=1

Microservices

cd k8s

Install OAuth2 authorization server:

kubectl create -f oauth2.yml

Install Configuration server:

kubectl create -f config.yml

Install the apps:

kubectl create -f subscription.yml

kubectl create -f billing.yml

Install API Gateway:

kubectl create -f apigw.yml

Install Ingress for the API Gateway service and OAuth2 server:

kubectl create -f apigw-ingress.yml

Test it!

Retrieve the Ingress Controller's external IP:

kubectl get service nginx-nginx-ingress-controller -n kube-system -o jsonpath='{.status.loadBalancer.ingress[].ip}'

Modify the tests/microservices.postman_environment.json to have:

  • apigw to have value of <Ingress-IP>
  • oauth to have value of <Ingress-IP>

Run the tests:

newman run Microservices.postman_collection.json -ke microservices.postman_environment.json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published