
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Download the monolith code and build your container
/ 10
Create a kubernetes cluster and deploy the application
/ 20
Create a containerized version of orders and product Microservices
/ 20
Deploy the new microservices
/ 20
Create a containerized version of the Frontend microservice
/ 10
Deploy the Frontend microservice
/ 20
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
This lab is recommended for students who have enrolled in the Build a Website on Google Cloud quest. Are you ready for the challenge?
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
You have just started a new role at FancyStore, Inc.
Your task is to take the company's existing monolithic e-commerce website and break it into a series of logically separated microservices. The existing monolith code is sitting in a GitHub repo, and you will be expected to containerize this app and then refactor it.
You are expected to have the skills and knowledge for these tasks, so don't expect step-by-step guides.
You have been asked to take the lead on this, after the last team suffered from monolith-related burnout and left for greener pastures (literally, they are running a lavender farm now). You will be tasked with pulling down the source code, building a container from it (one of the farmers left you a Dockerfile), and then pushing it out to GKE.
You should first build, deploy, and test the Monolith, just to make sure that the source code is sound. After that, you should break out the constituent services into their own microservice deployments.
Some FancyStore, Inc. standards you should follow:
Create your cluster in
Naming is normally team-resource, e.g. an instance could be named fancystore-orderservice1.
Allocate cost effective resource sizes. Projects are monitored and excessive resource use will result in the containing project's termination.
Use the e2-medium
machine type unless directed otherwise.
As soon as you sit down at your desk and open your new laptop, you receive the following request to complete these tasks. Good luck!
Log in to your new project and open up Cloud Shell.
First things first, you'll need to clone your team's git repo. There's a setup.sh script in the root directory of the project that you'll need to run to get your monolith container built up.
After running the setup.sh
script, ensure your Cloud Shell is running its latest version of nodeJS:
There will be a few different projects that can be built and pushed.
Push the monolith build (conveniently located in the monolith
directory) up to the Artifact Registry. There's a Dockerfile located in the ~/monotlith-to-microservices/monolith
folder which you can use to build the application container.
You will have to run Cloud Build (in that monolith folder) to build it, then push it up to Artifact Registry.
Name your artifact as follows:
Hint:
Make sure that you submit a build named
Click Check my progress to verify the objective.
Now that you have the image created and sitting in the Artifact Registry, it's time to create a cluster to deploy it to.
You've been told to deploy all of your resources in the
Cluster name:
Region:
Node count: 3
Hint:
Make sure your cluster is named
Now that you've built up an image, and have a cluster up and running, it's time to deploy your application.
You'll need to deploy the image that you've built onto your cluster. This will get your application up and running, but it can't be accessed until you expose it to the outside world. Your team has told you that the application runs on port 8080, but you will need to expose this on a more consumer-friendly port 80.
You should see the following:
Hint:
Make sure your deployment is named
Click Check my progress to verify the objective.
Now that you can build and deploy your Fancy Store monolith application, you're ready to start breaking it down into microservices!
Now that you have your existing monolith website running on GKE, you can start breaking each service into a microservice. Typically, a planning effort should take place on which services to break into smaller chunks, typically around specific parts of the application like business domain.
For the purposes of this Challenge, fast forward a bit and pretend that you have successfully broken out the monolith into a series of microservices: Orders, Products, and Frontend. Your code is ready, so now you've got to deploy your services.
There are 3 services that need to be broken out into their own containers. Since you are moving all of the services into containers, you need to track the following information for each service:
Create a containerized version of your microservices
Below is the set of services which need to be containerized.
Orders Microservice |
|
Products Microservice |
|
Hint: Make sure that you submit a build named
Click Check my progress to verify the objective.
Deploy these new containers following the same process that you followed for the
Orders Microservice |
|
Products Microservice |
|
NOTE: Please make note of the IP address of both the Orders and Products services once they have been exposed, you will need them in future steps.
http://ORDERS_EXTERNAL_IP/api/orders
http://PRODUCTS_EXTERNAL_IP/api/products
You will see each service return a JSON string if the deployments were successful.
Hint: Make sure your deployments are named
Click Check my progress to verify the objective.
Now that you have extracted both the Orders and Products microservice, you need to configure the Frontend service to point to them, and get it deployed.
nano
editor to replace the local URL with the IP address of the new Products microservices:When the editor opens, your file should look like this:
REACT_APP_PRODUCTS_URL
to the new format while replacing with your Orders and Product microservice IP addresses so it matches below:Press CTRL+O, press ENTER, then CTRL+X to save the file in the nano
editor.
Now rebuild the frontend app before containerizing it:
With the Orders and Products microservices now containerized and deployed, and the Frontend service configured to point to them, the final step is to containerize and deploy the Frontend.
Use Cloud Build to package up the contents of the Frontend service and push it up to Artifact Registry.
This process may take a few minutes, so be patient.
Hint: Make sure that you submit a build named
Click Check my progress to verify the objective.
Deploy this container following the same process that you followed for the "Orders" and "Products" microservices.
You will see the Fancy Store homepage, with links to the Products and Orders pages powered by your new microservices.
Click Check my progress to verify the objective.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated April 26, 2024
Lab Last Tested December 05, 2023
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one