Deploy A Microservice Based Application in Cloud Foundry

1.5 hours
  • 2 Learning Objectives

About this Hands-on Lab

In this Live Environment you will take on the role of a Developer. Your team has built an application that consists of two microservices. It’s ready to be deployed to production and it is your job to release it. You need create a single manifest that will deploy out both of the microcservies to Cloud Foundry executing a single push.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a manifest
Push the app to Cloud Foundry

Additional Resources

Register for a Pivotal Cloud Foundry account. http://run.pivotal.io/

Use the cf-cli to login into your Pivotal Cloud Foundry account.

Cleanup any lingering resources.

You will have two apps in /root: user-api and user-gui.

Create a manifest for your microservices in /root and call it user-app.yml. The manifest will have two appliations. The first one will be called user-api-<USERNAME>. The app name should be unique as to not cause any issues with the route. This app 256 Megs of RAM and 256 Megs of disk quota and 2 instances. Use the path attribute to specify the path to user-api.

The second app will be called user-gui.This app 256 Megs of RAM and 256 Megs of disk quota and 1 instances and it will need a random route. Use the path attribute to specify the path to user-gui. Create two environmental variables: API_URL and API_PORT. Set API_PORT to 80 and API_URL to <USER_API_NAME>.cfapps.io. USER_API_NAME should be the name you specifed for user-api-<USERNAME>.

Deploy your app to Cloud Foundry using the manifest. Use the -f flag to specify the file (/path_to/user-app.yml).

Verify the app deployed by pulling up user-gui a brower.

Once the app is verified deprovision both user-gui and user-api.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?