0
0
Kubernetesdevops~5 mins

Scaling Deployments in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of scaling a deployment in Kubernetes?
Scaling a deployment adjusts the number of pod replicas to handle more or less workload, ensuring the application can meet demand efficiently.
Click to reveal answer
beginner
Which command scales a deployment named 'webapp' to 5 replicas?
kubectl scale deployment webapp --replicas=5
Click to reveal answer
intermediate
What is the difference between manual and automatic scaling in Kubernetes?
Manual scaling requires you to specify the number of replicas yourself. Automatic scaling uses metrics like CPU usage to adjust replicas automatically.
Click to reveal answer
intermediate
What Kubernetes resource is used for automatic scaling of deployments?
The Horizontal Pod Autoscaler (HPA) automatically adjusts the number of pod replicas based on observed metrics like CPU or memory usage.
Click to reveal answer
beginner
How do you check the current number of replicas for a deployment named 'api-server'?
Use the command: kubectl get deployment api-server to see the current replicas and status.
Click to reveal answer
Which command scales a deployment named 'frontend' to 3 replicas?
Akubectl set replicas frontend 3
Bkubectl scale deployment frontend --replicas=3
Ckubectl deploy scale frontend 3
Dkubectl update deployment frontend replicas=3
What does the Horizontal Pod Autoscaler (HPA) use to decide when to scale pods?
ANumber of nodes in the cluster
BUser manual input
CMetrics like CPU or memory usage
DPod restart count
If you want to reduce the number of replicas from 10 to 4 manually, which command would you use?
Akubectl set replicas myapp 4
Bkubectl reduce deployment myapp 4
Ckubectl update deployment myapp replicas=4
Dkubectl scale deployment myapp --replicas=4
How can you view the current number of replicas and their status for a deployment?
Akubectl get deployment <deployment-name>
Bkubectl scale deployment
Ckubectl logs deployment
Dkubectl describe pods
Which of the following is NOT a benefit of scaling deployments?
AAutomatically fixing code bugs
BReducing resource waste
CHandling increased traffic
DImproving application availability
Explain how you would manually scale a Kubernetes deployment and why you might want to do this.
Think about adjusting the number of pods to match demand.
You got /4 concepts.
    Describe what the Horizontal Pod Autoscaler does and how it helps manage deployments.
    Consider how Kubernetes can watch resource use and change pod count.
    You got /4 concepts.