PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #6
Your team has recently deployed an NGINX-based application into Google Kubernetes Engine (GKE) and has exposed it to the public via an HTTP Google Cloud Load Balancer (GCLB) ingress. You want to…
The correct answer is C. Install the Stackdriver custom metrics adapter and configure a horizontal pod autoscaler to use. To scale a GKE deployment based on application-specific SLIs like NGINX request rates, you should install the Stackdriver custom metrics adapter and configure a Horizontal Pod Autoscaler.
Question
Options
- AConfigure the horizontal pod autoscaler to use the average response time from the Liveness and
- BConfigure the vertical pod autoscaler in GKE and enable the cluster autoscaler to scale the
- CInstall the Stackdriver custom metrics adapter and configure a horizontal pod autoscaler to use
- DExpose the NGINX stats endpoint and configure the horizontal pod autoscaler to use the request
How the community answered
(42 responses)- A14% (6)
- B2% (1)
- C76% (32)
- D7% (3)
Why each option
To scale a GKE deployment based on application-specific SLIs like NGINX request rates, you should install the Stackdriver custom metrics adapter and configure a Horizontal Pod Autoscaler.
Liveness and Readiness probes are used for health checks and traffic routing, not for providing performance metrics like average response time for autoscaling.
Vertical Pod Autoscaler (VPA) adjusts resource requests/limits for individual pods, and Cluster Autoscaler scales the underlying nodes. Neither directly scales *deployments* based on application SLIs; HPA is designed for that purpose.
The Horizontal Pod Autoscaler (HPA) in Kubernetes can scale deployments based on CPU/memory usage or custom metrics. The Stackdriver custom metrics adapter allows the HPA to consume custom metrics (like NGINX request rates or response times) from Cloud Monitoring, enabling scaling decisions based on application-specific Service Level Indicators.
While exposing the NGINX stats endpoint is good for collecting metrics, the HPA cannot directly consume metrics from it. These metrics must first be collected and made available to the HPA via a custom metrics API, which is facilitated by the Stackdriver custom metrics adapter.
Concept tested: Kubernetes HPA, Custom Metrics, GKE Monitoring
Source: https://cloud.google.com/monitoring/kubernetes-engine/customize-hpa
Topics
Community Discussion
No community discussion yet for this question.