Explanation
Correct Answer: A) Managed Instance Group with autoscaling
Managed Instance Groups (MIGs) with autoscaling are the optimal solution for this scenario because:
- Auto-scaling based on CPU: MIGs support autoscaling policies that can scale VMs up or down based on CPU utilization metrics.
- Single binary application: MIGs can deploy identical VM instances with the same application binary across all instances.
- Load balancing: MIGs integrate with Google Cloud load balancers to distribute traffic across healthy instances.
- Health checking: MIGs automatically replace unhealthy instances.
- Stateless scaling: For a single binary application, MIGs provide the simplest scaling solution.
Why other options are incorrect:
- B) Single VM with cron jobs: A single VM cannot auto-scale and cron jobs don't provide dynamic scaling based on CPU utilization.
- C) Preemptible VM only: Preemptible VMs are cost-effective but can be terminated at any time and don't provide auto-scaling capabilities.
- D) GKE cluster: While GKE can auto-scale, it's designed for containerized applications, not single binary applications running directly on VMs. GKE would add unnecessary complexity for a simple binary application.
Key Takeaway: For stateless applications that need to scale based on metrics like CPU utilization, Managed Instance Groups with autoscaling are the recommended Google Cloud solution.