You are deploying a new stateless checkout API container image to an existing GKE Standard cluster that already hosts several internal microservices. Requirements are:
The API must be reachable only by other workloads inside the cluster.
A minimum of 2 replicas must be running at all times and the workload must automatically scale up to 10 replicas whenever the average CPU utilization across pods exceeds 70 %.
You want to avoid creating any external or internal load-balancer resources that would add cost and management overhead.
Which set of Kubernetes resources best satisfies these requirements?
Create a Deployment with 2 replicas and expose it using a Service of type NodePort; restrict access with additional VPC firewall rules.
Create a Deployment with 2 replicas and expose it using a Service of type LoadBalancer annotated for an internal load balancer; rely on the Deployment's rolling-update strategy for scaling.
Create a Deployment initially set to 2 replicas, an HPA targeting the Deployment with minReplicas 2, maxReplicas 10, and 70 % CPU threshold, and expose it with a Service of type ClusterIP.
Create a StatefulSet with 2 replicas, attach an HPA, and expose it through a Service of type NodePort.
A Deployment lets you declaratively manage a replica set of stateless pods and performs rolling updates. Pairing it with a HorizontalPodAutoscaler (HPA) provides automatic scaling based on metrics such as CPU utilization; you can set minReplicas = 2, maxReplicas = 10, and a 70 % CPU target so at least two pods are always available while still scaling on demand. Exposing the pods with a Service of type ClusterIP makes the endpoint reachable only inside the cluster-no Cloud Load Balancer or node-port is created, eliminating unnecessary cost and configuration effort.
Using a Service of type LoadBalancer (even with an "internal" annotation) would still provision a Google Cloud internal load balancer, which the scenario wants to avoid. A StatefulSet is intended for workloads that need stable identities and storage and is unnecessary for stateless microservices. A Service of type NodePort relies on node IPs and open ports; while it avoids a load balancer, it can expose the service outside the cluster and requires VPC firewall management, increasing operational overhead.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a Deployment in Kubernetes?
Open an interactive chat with Bash
How does a HorizontalPodAutoscaler (HPA) work?
Open an interactive chat with Bash
Why is a Service of type ClusterIP used in this scenario?
Open an interactive chat with Bash
What is the purpose of an HPA in Kubernetes?
Open an interactive chat with Bash
Why use ClusterIP for exposing services internally?
Open an interactive chat with Bash
How does a Deployment manage rolling updates in Kubernetes?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Planning and implementing a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .