Google Professional Cloud Developer Question 372
Select 2Google Cloud PlatformYou are deploying a containerized application to a Google Kubernetes Engine (GKE) cluster. The application requires an external endpoint to be accessible over the internet, and it also needs to automatically scale based on CPU utilization. Which steps should you take to fulfill these requirements?
- A
Create a Kubernetes Deployment for the application and expose it using a Service of type LoadBalancer.
- B
Use Horizontal Pod Autoscaler (HPA) to configure CPU-based scaling for the Deployment.
- C
Configure a Kubernetes CronJob to ensure the application scales when CPU usage increases.
- D
Expose the application using a Service of type NodePort to make it accessible externally.
- E
Set up a GKE Ingress resource to manage external accessibility along with an HTTPS load balancer.
Show answer and explanation
Correct answers: A, B
Explanation
To meet the requirements, you need to deploy the containerized application using a Kubernetes Deployment and expose it using a Service of type LoadBalancer for external access. Additionally, to handle automatic scaling based on CPU utilization, you should use Horizontal Pod Autoscaler (HPA). Other options either address different use cases or are not necessary for this scenario.
- A. Correct.
Correct: A Kubernetes Deployment is necessary to manage the containerized application, and a Service of type LoadBalancer is used to expose the application externally with an external IP address.
- B. Correct.
Correct: Horizontal Pod Autoscaler (HPA) is the standard way to configure automatic scaling based on metrics such as CPU utilization in Kubernetes.
- C. Incorrect.
Incorrect: A Kubernetes CronJob is used for scheduled tasks, not for scaling applications based on CPU usage.
- D. Incorrect.
Incorrect: While a NodePort service exposes the application externally, it is not recommended for production-grade external access as it doesn't provide a managed load balancer.
- E. Incorrect.
Incorrect: While an Ingress resource can manage external access and HTTPS load balancing, it is not explicitly required for this scenario. A LoadBalancer service is sufficient for external accessibility in this case.