Skip to content

Latest commit

 

History

History
84 lines (69 loc) · 2.52 KB

lab_08.adoc

File metadata and controls

84 lines (69 loc) · 2.52 KB

Lab 8 - Push Microservices to Cloud Foundry

Build and Push!

  1. Return to the Fortune Teller application directory that you finished in Lab 7:

    $ cd $COURSE_HOME/labs/initial/fortune-teller
  2. Using Maven, build and package the application:

    $ mvn package

    Maven will automatically download all of Fortune Teller's dependencies. This may take a few moments.

  3. Run scripts/create_services.sh to create the services that you need:

    $ scripts/create_services.sh
    Creating service instance config-server in org org platform-eng / space nfjs-workshop as [email protected]...
    OK
    Creating service instance service-registry in org platform-eng / space nfjs-workshop as [email protected]...
    OK
    Creating service instance circuit-breaker in org platform-eng / space nfjs-workshop as [email protected]...
    OK
    Creating service instance fortune-db in org org platform-eng / space nfjs-workshop as [email protected]...
    OK
  4. In your PCF Space Dashboard, click Manage for your Config Server instance:

    space dashboard

  5. In the resulting Config Server Dashboard, ensure that Git is selected, paste https://github.com/saurabhguptasg/cnw-config-repo.git into the Git URI field, and click Submit:

    config server dashboard

  6. Push the microservices:

    $ cf push -f manifest-apps.yml

    This will push the fortunes service and the ui application.

  7. In a browser, access the fortunes-ui application at the route that was created for you:

    fortunes 1

  8. In your PCF Space Dashboard, click Manage for your Circuit Breaker Dashboard instance:

    space dashboard 2

  9. Access the fortunes-ui and show that the circuit breaker is registering successful requests.

    pcf circuit breaker 1

  10. Stop the fortunes application:

    $ cf stop fortune-service
  11. Access the fortunes-ui and see that the “fallback fortune” is being returned.

    fortunes 5

  12. Access the fortunes-ui and show that the circuit breaker is registering short-circuited requests.

    pcf circuit breaker 2

  13. Start the fortunes application:

    $ cf start fortune-service
  14. Continue to access the fortunes-ui and watch the dashboard. After the fortunes service has re-registered with Eureka and the fortunes-ui load balancer caches are refreshed, you will see the circuit breaker recover. You should then start getting random fortunes again!