Deploying Dockerized HTTPS Web Application on Google Kubernetes Engine (GKE)

Deploying a Dockerized HTTPS Web Application on GKE

Question

A development team at your company has created a dockerized HTTPS web application.

You need to deploy the application on Google Kubernetes Engine (GKE) and make sure that the application scales automatically.

How should you deploy to GKE?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.

https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-autoscaler

The best option for deploying the dockerized HTTPS web application on Google Kubernetes Engine (GKE) and making sure that the application scales automatically is Option B: Use the Horizontal Pod Autoscaler and enable cluster autoscaling on the Kubernetes cluster. Use a Service resource of type LoadBalancer to load-balance the HTTPS traffic.

Here's why:

Option A: This option suggests using the Horizontal Pod Autoscaler and enabling cluster autoscaling, which is correct. However, using an Ingress resource to load-balance HTTPS traffic is not sufficient as Ingress does not provide load balancing natively. Ingress requires an additional layer of configuration, such as a Kubernetes Service object, to actually load-balance traffic. Therefore, this option is not the best one.

Option B: This option suggests using the Horizontal Pod Autoscaler to scale the application automatically, which is required. It also suggests enabling cluster autoscaling on the Kubernetes cluster, which is a good practice to ensure that the cluster can accommodate the increased workload as the number of pods increase. Additionally, this option suggests using a Service resource of type LoadBalancer to load-balance HTTPS traffic, which is also required. The LoadBalancer service type exposes the service externally using a Google Cloud Load Balancer. Hence, this option is the best choice for deploying the application.

Option C: This option suggests enabling autoscaling on the Compute Engine instance group, which is incorrect. Autoscaling on the Compute Engine instance group would not automatically scale the Kubernetes cluster or the pods within it. Additionally, using an Ingress resource to load-balance HTTPS traffic is not sufficient as Ingress does not provide load balancing natively, as explained earlier.

Option D: This option suggests enabling autoscaling on the Compute Engine instance group, which is incorrect. Autoscaling on the Compute Engine instance group would not automatically scale the Kubernetes cluster or the pods within it. Additionally, using a Service resource of type LoadBalancer to load-balance HTTPS traffic is required, but it should be deployed within the Kubernetes cluster and not on Compute Engine instance groups.

In summary, option B is the best choice as it enables both the Horizontal Pod Autoscaler and cluster autoscaling on the Kubernetes cluster and uses a Service resource of type LoadBalancer to load-balance HTTPS traffic.