
Answer-first summary for fast verification
Answer: Use a Horizontal Pod Autoscaler to scale the containers, and expose them via a ClusterIP Service.
The question requires a service that scales quickly and is only accessible within the GKE cluster. The Horizontal Pod Autoscaler (HPA) is ideal for rapid scaling as it adjusts the number of pod replicas, which is faster than Vertical Pod Autoscaler (VPA) that resizes existing pods (often requiring restarts). A ClusterIP Service is appropriate for internal cluster communication, as it assigns a virtual IP accessible only within the cluster. NodePort (exposing a static port on nodes) is unnecessary here since external access isn't needed. Thus, option C (HPA + ClusterIP) meets both requirements.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your team builds stateless services running on Google Kubernetes Engine (GKE). You must deploy a new service that will only be accessed by other services within the same GKE cluster. The service needs to scale rapidly to handle fluctuating workloads. What is the recommended approach?
A
Use a Vertical Pod Autoscaler to scale the containers, and expose them via a ClusterIP Service.
B
Use a Vertical Pod Autoscaler to scale the containers, and expose them via a NodePort Service.
C
Use a Horizontal Pod Autoscaler to scale the containers, and expose them via a ClusterIP Service.
D
Use a Horizontal Pod Autoscaler to scale the containers, and expose them via a NodePort Service.
No comments yet.