A cloud engineer needs to manually scale out an application deployment named `frontend-service` running in a Google Kubernetes Engine (GKE) cluster from 5 pod replicas to 20 pod replicas to handle an upcoming promotional event. The cluster already has sufficient node capacity to accommodate the additional workload. Which command should the engineer run to scale the application workload?
- kubectl scale deployment frontend-service --replicas=20Answer
- Bgcloud container clusters resize production-cluster --node-pool=default-pool --num-nodes=20
- Cgcloud container clusters update production-cluster --enable-autoscaling --min-nodes=5 --max-nodes=20
- Dgcloud container node-pools update default-pool --cluster=production-cluster --replicas=20
Answer
Execute `kubectl scale deployment frontend-service --replicas=20` to update the application deployment workload replica count.
The `kubectl scale deployment` command updates the `spec.replicas` field of a Kubernetes Deployment. Because the GKE cluster already possesses adequate node compute capacity, increasing the pod count via `kubectl` immediately schedules the required additional replicas.
Step-by-Step Solution
Key Concept
Scaling GKE Workloads vs. Scaling GKE Node Infrastructure
Estimated Time:1m 30s