A simple microservice-based exercise using SpringBoot:
- Requires Docker, Kubernetes, Helm, Java 8, and Maven
- At run-time, fetches configurations from Configuration Github
mvn clean package docker:build
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
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
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