O'Reilly logo

Google Cloud Platform Cookbook by Legorie Rajan PS

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

For this recipe, we'll follow these steps:

  1. Create a web instance for normal traffic
  2. Map the instance to the web instance group
  3. Create another instance for image traffic
  4. Map this instance to the video instance group
  5. Create a firewall rule to allow tcp:80 for all servers tagged http-server
  6. Create a bucket and a static folder for static content
  7. Create a health check that will be used for the load balancer configuration
  8. Create a load balancer with content-based routing rules for web, image, and static content

We'll see the preceding steps in details as follows:

  1. Create the web instance and install Apache using the start up script. We'll also add the network tag http-server to be used by our firewall rules:
gcloud compute instances ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required