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 ...

Get Building Google Cloud Platform Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.