Autoscaling Quiz
Quiz
Question 1 of 20
(0 answered)
Question 1
What is the default interval at which the HPA controller queries the Metrics API?
โ
Correct!
The HPA controller queries the Metrics API every 15 seconds by default to calculate desired replica counts.
โ
Incorrect
The HPA controller queries the Metrics API every 15 seconds by default to calculate desired replica counts.
This is different from the Metrics Server scrape interval.
Question 2
Which of the following are required for HPA to function properly?
โ
Correct!
HPA requires Metrics Server for metrics, resource requests to calculate utilization percentages, and at least one replica to scale. VPA is a separate autoscaler and not required for HPA.
โ
Incorrect
HPA requires Metrics Server for metrics, resource requests to calculate utilization percentages, and at least one replica to scale. VPA is a separate autoscaler and not required for HPA.
Think about what HPA needs to calculate utilization and make scaling decisions.
Question 3
Karpenter provisions nodes faster than Cluster Autoscaler because it provisions directly through cloud provider APIs rather than scaling node groups.
โ
Correct!
Karpenter typically provisions nodes in 30-90 seconds by calling cloud APIs directly, while Cluster Autoscaler takes 2-5 minutes because it works through ASG/node group scaling.
โ
Incorrect
Karpenter typically provisions nodes in 30-90 seconds by calling cloud APIs directly, while Cluster Autoscaler takes 2-5 minutes because it works through ASG/node group scaling.
Consider the architectural difference between direct API calls and group-based scaling.
Question 4
Using the HPA formula, calculate the desired replicas:
currentReplicas = 3
currentCPU = 90%
targetCPU = 50%
desiredReplicas = ceil[currentReplicas * (currentCPU / targetCPU)]What will this code output?
โ
Correct!
desiredReplicas = ceil[3 * (90/50)] = ceil[3 * 1.8] = ceil[5.4] = 6 pods
โ
Incorrect
desiredReplicas = ceil[3 * (90/50)] = ceil[3 * 1.8] = ceil[5.4] = 6 pods
Remember to use ceiling function on the final result.
Question 5
Which VPA update mode should be used for databases where automatic restarts are risky?
โ
Correct!
The ‘Off’ mode only provides recommendations without automatic updates, making it safe for stateful workloads like databases where unexpected restarts could cause issues.
โ
Incorrect
The ‘Off’ mode only provides recommendations without automatic updates, making it safe for stateful workloads like databases where unexpected restarts could cause issues.
Databases need careful handling when changing resources.
Question 6
What component embedded in Kubelet collects container-level metrics like CPU, memory, and network I/O?
โ
Correct!
cAdvisor (Container Advisor) is embedded in Kubelet and collects container-level metrics from the container runtime.
โ
Incorrect
cAdvisor (Container Advisor) is embedded in Kubelet and collects container-level metrics from the container runtime.
Its full name is Container Advisor.
Question 7
Arrange the metrics collection flow from container to HPA:
Drag to arrange in the correct order
โฎโฎ
Container Runtime
โฎโฎ
cAdvisor
โฎโฎ
Kubelet
โฎโฎ
Metrics Server
โฎโฎ
HPA Controller
โ
Correct!
Container Runtime runs containers โ cAdvisor collects metrics โ Kubelet aggregates โ Metrics Server queries and aggregates cluster-wide โ HPA Controller consumes metrics for scaling decisions.
โ
Incorrect
Container Runtime runs containers โ cAdvisor collects metrics โ Kubelet aggregates โ Metrics Server queries and aggregates cluster-wide โ HPA Controller consumes metrics for scaling decisions.
Question 8
Which are valid KEDA trigger sources for event-driven autoscaling?
โ
Correct!
KEDA scales based on external event sources like SQS queues, Kafka topics, and custom webhooks. Node CPU is handled by standard HPA, not KEDA’s event-driven model.
โ
Incorrect
KEDA scales based on external event sources like SQS queues, Kafka topics, and custom webhooks. Node CPU is handled by standard HPA, not KEDA’s event-driven model.
KEDA focuses on external events, not resource metrics.
Question 9
VPA and HPA can safely be used together on the same deployment scaling on the same metric (CPU).
โ
Correct!
Using VPA and HPA together on the same metric can cause conflicts. VPA adjusts resource requests while HPA scales based on utilization of those requests, potentially causing unpredictable behavior.
โ
Incorrect
Using VPA and HPA together on the same metric can cause conflicts. VPA adjusts resource requests while HPA scales based on utilization of those requests, potentially causing unpredictable behavior.
Consider what happens when both try to optimize CPU at the same time.
Question 10
In Karpenter, what is the purpose of the NodeClass (EC2NodeClass)?
โ
Correct!
NodeClass defines HOW to create nodes - cloud-specific configuration like AMI selection, subnets, security groups, and IAM roles. NodePool defines WHAT nodes to create.
โ
Incorrect
NodeClass defines HOW to create nodes - cloud-specific configuration like AMI selection, subnets, security groups, and IAM roles. NodePool defines WHAT nodes to create.
NodePool and NodeClass have distinct responsibilities.
Question 11
Complete the HPA behavior policy to prevent aggressive scale-down:
Fill in the parameter that limits scale-down to 50% of pods
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: _____
value: 50
periodSeconds: 60โ
Correct!
The ‘Percent’ type allows you to specify scale-down as a percentage of current replicas, preventing too many pods from being removed at once.
โ
Incorrect
The ‘Percent’ type allows you to specify scale-down as a percentage of current replicas, preventing too many pods from being removed at once.
Question 12
What is the key difference between Cluster Autoscaler and Karpenter in terms of instance selection?
What is the key difference between Cluster Autoscaler and Karpenter in terms of instance selection?
Cluster Autoscaler is limited to pre-defined instance types configured in ASGs/node groups.
Karpenter dynamically selects the optimal instance type from the entire cloud provider catalog based on actual pod requirements, enabling better bin-packing and cost optimization.
Did you get it right?
โ
Correct!
โ
Incorrect
Question 13
What does Karpenter’s consolidation policy ‘WhenUnderutilized’ do?
โ
Correct!
WhenUnderutilized actively consolidates by combining pods from multiple underutilized nodes, deleting unnecessary nodes, and potentially replacing nodes with cheaper/smaller instances.
โ
Incorrect
WhenUnderutilized actively consolidates by combining pods from multiple underutilized nodes, deleting unnecessary nodes, and potentially replacing nodes with cheaper/smaller instances.
Think about active optimization, not just cleanup.
Question 14
In the HPA formula
desiredReplicas = ceil[currentReplicas * (currentMetric / targetMetric)], what mathematical function is applied to the result?โ
Correct!
The ceiling function (ceil) is used to round up, ensuring there are always enough replicas to handle the load.
โ
Incorrect
The ceiling function (ceil) is used to round up, ensuring there are always enough replicas to handle the load.
It rounds in a specific direction.
Question 15
The Metrics Server stores historical metrics data for long-term analysis.
โ
Correct!
Metrics Server stores only short-term, in-memory data with no historical retention. For historical metrics, you need a dedicated monitoring solution like Prometheus.
โ
Incorrect
Metrics Server stores only short-term, in-memory data with no historical retention. For historical metrics, you need a dedicated monitoring solution like Prometheus.
Consider its purpose as a real-time metrics aggregator.
Question 16
Which actions does Karpenter perform for cost optimization?
โ
Correct!
Karpenter performs all these optimizations: removes empty nodes, consolidates underutilized ones, replaces with cheaper instances when possible, and gracefully handles spot interruptions with replacement provisioning.
โ
Incorrect
Karpenter performs all these optimizations: removes empty nodes, consolidates underutilized ones, replaces with cheaper instances when possible, and gracefully handles spot interruptions with replacement provisioning.
Karpenter is designed for comprehensive cost optimization.
Question 17
Which VPA component is responsible for evicting pods that need resource updates?
โ
Correct!
The Updater component compares current vs recommended requests and evicts pods when updates are needed. The Admission Controller then sets new requests on recreated pods.
โ
Incorrect
The Updater component compares current vs recommended requests and evicts pods when updates are needed. The Admission Controller then sets new requests on recreated pods.
Each VPA component has a specific role in the update workflow.
Question 18
Arrange the VPA workflow steps in correct order:
Drag to arrange in the correct order
โฎโฎ
Recommender analyzes metrics
โฎโฎ
Updater evicts pod
โฎโฎ
Admission Controller mutates new pod
โฎโฎ
New pod starts with optimal requests
โ
Correct!
Recommender analyzes usage and updates recommendations โ Updater sees difference and evicts pod โ Admission Controller intercepts pod creation and applies recommendations โ New pod runs with optimized resources.
โ
Incorrect
Recommender analyzes usage and updates recommendations โ Updater sees difference and evicts pod โ Admission Controller intercepts pod creation and applies recommendations โ New pod runs with optimized resources.
Question 19
Why is stabilizationWindowSeconds important for HPA scale-down behavior?
Why is stabilizationWindowSeconds important for HPA scale-down behavior?
stabilizationWindowSeconds prevents “flapping” - rapid scale up/down cycles caused by temporary metric fluctuations.
By requiring metrics to stay below the threshold for the window duration (e.g., 300 seconds), HPA avoids premature scale-down that could cause capacity issues when load returns.
Did you get it right?
โ
Correct!
โ
Incorrect
Question 20
A deployment has these resource specifications. What percentage CPU utilization triggers HPA scaling?
resources:
requests:
cpu: 200m
limits:
cpu: 500m
HPA target: averageUtilization: 70What will this code output?
โ
Correct!
HPA calculates utilization based on resource requests, not limits. 70% of 200m request = 140m. When average CPU usage exceeds 140m per pod, HPA scales up.
โ
Incorrect
HPA calculates utilization based on resource requests, not limits. 70% of 200m request = 140m. When average CPU usage exceeds 140m per pod, HPA scales up.
Utilization percentage is calculated against requests.
Quiz Results
Score
0/0
Accuracy
0%
Right
0
Wrong
Skipped
0
Last updated on