Question

Difficulty: EasyManaging Google Kubernetes Engine Resources

A cloud engineer needs to manually scale a running GKE Deployment named 'web-app' to 5 replicas and verify the deployment status using command-line tools. Arrange the operational steps in the correct chronological order from first to last.

  1. 1Fetch cluster credentials using 'gcloud container clusters get-credentials my-cluster --zone us-central1-a' to configure local kubectl context.
  2. 2Inspect the existing status and replica count of the workload using 'kubectl get deployment web-app'.
  3. 3Execute 'kubectl scale deployment web-app --replicas=5' to request additional Pod replicas.
  4. 4Verify that new Pods are scheduled and running by executing 'kubectl get pods -l app=web-app'.

Answer

The correct operational sequence is: 1) Retrieve cluster credentials via gcloud, 2) Inspect current deployment status using kubectl get deployment, 3) Scale the deployment to 5 replicas using kubectl scale, and 4) Verify new pod creation using kubectl get pods.
To manage Kubernetes resources from a local terminal, an engineer must first authenticate and obtain cluster credentials using gcloud. Next, inspecting the current deployment state establishes a baseline. Executing the scale command updates the Deployment manifest in the GKE control plane. Finally, querying pod status verifies successful scheduling and pod startup.

Step-by-Step Solution

1
Authenticate and set context
Local kubeconfig is populated with cluster endpoint and authentication details.
kubectl commands cannot communicate with the GKE control plane without valid cluster credentials.
2
Inspect workload baseline
Current deployment specifications and active replica counts are displayed.
Verifying current workload state confirms target deployment existence and establishes a baseline.
3
Scale workload replicas
Deployment spec desired replica count is updated to 5.
The scale command modifies the deployment spec to trigger Kubernetes controller reconciliation.
4
Verify pod status
All 5 pod instances are listed with Status: Running.
Operational verification ensures cluster nodes have successfully provisioned and started the requested pods.

Key Concept

Manual scaling and status verification of GKE Deployments using gcloud and kubectl CLI tools
Rate this question