0
0
Kubernetesdevops~20 mins

Vertical Pod Autoscaler concept in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Vertical Pod Autoscaler Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary function of the Vertical Pod Autoscaler (VPA) in Kubernetes?

Choose the best description of what the Vertical Pod Autoscaler does in a Kubernetes cluster.

AIt scales the number of pod replicas up or down based on incoming traffic.
BIt automatically adjusts the CPU and memory requests of pods based on usage patterns.
CIt manages persistent storage volumes for pods dynamically.
DIt schedules pods to nodes based on node labels and taints.
Attempts:
2 left
💡 Hint

Think about resource allocation inside a pod rather than the number of pods.

💻 Command Output
intermediate
2:00remaining
What is the output of this command related to VPA?

Given the command kubectl get vpa in a cluster with one VPA resource named my-app-vpa, what is the expected output?

Kubernetes
kubectl get vpa
A
NAME        READY
my-app-vpa  True
BNo resources found in default namespace.
C
NAME        RECOMMENDATION
my-app-vpa  cpu: 500m, memory: 256Mi
DError from server (NotFound): verticalpodautoscalers.autoscaling.k8s.io "my-app-vpa" not found
Attempts:
2 left
💡 Hint

The command lists VPA resources and their current recommendations.

Configuration
advanced
3:00remaining
Which VPA configuration snippet correctly sets the update mode to 'Auto'?

Identify the correct YAML snippet that configures a Vertical Pod Autoscaler with update mode set to Auto.

A
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: example-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: example-deployment
  updatePolicy:
    update_mode: Auto
B
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: example-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: example-deployment
  updatePolicy:
    updateMode: Manual
C
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: example-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: example-deployment
  updatePolicy:
    mode: Auto
D
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: example-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: example-deployment
  updatePolicy:
    updateMode: Auto
Attempts:
2 left
💡 Hint

Check the exact field name and value for update mode in the VPA spec.

Troubleshoot
advanced
3:00remaining
Why might a VPA not update pod resources even when usage is high?

Given a VPA configured with updateMode: Auto, pods still run with old resource requests despite high CPU and memory usage. What is a likely cause?

AThe VPA cannot update running pods; it only updates resource requests for new pods after restart.
BThe pods are managed by a Deployment with <code>replicaSet</code> and VPA does not support Deployments.
CThe VPA is in <code>Auto</code> mode but the pods have <code>resourceLimits</code> set too low.
DThe VPA is configured with <code>updateMode: Off</code> instead of <code>Auto</code>.
Attempts:
2 left
💡 Hint

Think about how resource changes affect running pods.

Best Practice
expert
4:00remaining
What is the recommended approach to safely use VPA with Horizontal Pod Autoscaler (HPA)?

When using both Vertical Pod Autoscaler and Horizontal Pod Autoscaler together, which practice helps avoid conflicts and ensures stable scaling?

ASet VPA update mode to <code>Initial</code> so it only sets resources at pod start, while HPA manages pod count.
BConfigure VPA in <code>Off</code> mode and let HPA handle all scaling decisions.
CSet VPA update mode to <code>Auto</code> and HPA to scale based on CPU only.
DRun VPA and HPA with no coordination; Kubernetes will handle conflicts automatically.
Attempts:
2 left
💡 Hint

Consider how resource changes and pod count scaling interact.