Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 1.86 KB

api-gateway.adoc

File metadata and controls

52 lines (39 loc) · 1.86 KB

Deploy api-gateway (Spring Boot)

The API-Gateway is a microservices architectural pattern. For more information about this pattern, visit: http://microservices.io/patterns/apigateway.html

(Option 1) Deploy project via oc CLI

Basic project creation
$ git clone https://github.com/redhat-helloworld-msa/api-gateway
$ cd api-gateway/
$ oc new-build --binary --name=api-gateway -l app=api-gateway
$ mvn package; oc start-build api-gateway --from-dir=. --follow
$ oc new-app api-gateway -l app=api-gateway,hystrix.enabled=true
$ oc expose service api-gateway
Enable Jolokia and Readiness probe
$ oc set env dc/api-gateway AB_ENABLED=jolokia; oc patch dc/api-gateway -p '{"spec":{"template":{"spec":{"containers":[{"name":"api-gateway","ports":[{"containerPort": 8778,"name":"jolokia"}]}]}}}}'
$ oc set probe dc/api-gateway --readiness --get-url=http://:8080/health

(Option 2) Deploy project via Fabric8 Maven Plugin

$ mvn package fabric8:deploy

Test the endpoint

curl http://api-gateway-helloworld-msa.`minishift ip`.nip.io/api/gateway