How can you enable horizontal pod autoscaling in OpenShift, and what metrics does it use by default?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

How can you enable horizontal pod autoscaling in OpenShift, and what metrics does it use by default?

Explanation:
Horizontal Pod Autoscaling in OpenShift is configured by creating an HorizontalPodAutoscaler that targets a specific deployment (or deployment config) and defines how many pods to scale between. The default behavior is to scale based on CPU utilization, looking at the average CPU usage across all pods relative to each pod’s requested CPU. If the observed usage rises above the target, more pods are added; if it falls below, pods can be reduced, all within the defined minimum and maximum replica bounds. You can also switch to custom metrics by configuring the HPA to use metrics from the Custom Metrics API (for example, Prometheus) to scale on other measurements. This is why the correct approach is to create an HPA resource that scales based on CPU by default, with the option to use custom metrics if configured.

Horizontal Pod Autoscaling in OpenShift is configured by creating an HorizontalPodAutoscaler that targets a specific deployment (or deployment config) and defines how many pods to scale between. The default behavior is to scale based on CPU utilization, looking at the average CPU usage across all pods relative to each pod’s requested CPU. If the observed usage rises above the target, more pods are added; if it falls below, pods can be reduced, all within the defined minimum and maximum replica bounds. You can also switch to custom metrics by configuring the HPA to use metrics from the Custom Metrics API (for example, Prometheus) to scale on other measurements. This is why the correct approach is to create an HPA resource that scales based on CPU by default, with the option to use custom metrics if configured.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy