Containerized Web Application Deployment for Cost Optimization in Google Cloud

Deploying a Containerized Web Application for Cost Optimization in Google Cloud

Question

You have developed a containerized web application that will serve internal colleagues during business hours.

You want to ensure that no costs are incurred outside of the hours the application is used.

You have just created a new Google Cloud project and want to deploy the application.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

The most cost-effective solution for deploying a containerized web application that will only be used during business hours is to use a serverless platform that allows you to scale down to zero instances when there is no traffic. This will prevent you from incurring any costs outside of business hours.

The best option from the provided answers is to deploy the container on Cloud Run (fully managed) and set the minimum number of instances to zero (option B). Cloud Run is a serverless platform that allows you to run stateless containers that automatically scale up or down depending on the incoming traffic. With Cloud Run, you only pay for the actual time your code is running, rounded up to the nearest 100 milliseconds. By setting the minimum number of instances to zero, you ensure that no resources will be consumed when there is no traffic to your application.

Option A, deploying the container on Cloud Run for Anthos, is not the best solution because it requires you to manage and maintain the Kubernetes cluster yourself, which can be more complex and costly than using a fully managed serverless platform.

Option C, deploying the container on App Engine flexible environment with autoscaling and setting the value min_instances to zero in the app.yaml, is also a viable solution. However, Cloud Run is a more cost-effective solution because it only charges for the exact time your code is running, whereas App Engine charges for the entire instance, even if it is idle.

Option D, deploying the container on App Engine flexible environment with manual scaling and setting the value instances to zero in the app.yaml, is not the best solution because it requires manual intervention to scale down to zero instances, which is not optimal for a serverless application.