For this recipe, we'll follow these steps:
- Create a web instance for normal traffic
- Map the instance to the web instance group
- Create another instance for image traffic
- Map this instance to the video instance group
- Create a firewall rule to allow tcp:80 for all servers tagged http-server
- Create a bucket and a static folder for static content
- Create a health check that will be used for the load balancer configuration
- 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:
- 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 ...