appsops.observer
← All labs

Kubernetes scheduling / Intermediate / 20–30 min

The workload waiting for a node

A deployment's pod remains Pending because no eligible node satisfies its placement requirement. Investigate scheduler events and restore placement.

LAB IDapps-02-pending-node-selectorTRACK / appsops.observer
Engineer investigating application systems at a workstation

The scenario

A cache workload must run on the lab's worker node, but its pod never gets assigned. Find the scheduling constraint and restore the intended placement without changing the Deployment.

Mission objectives

  • Inspect the Pending pod and its scheduler events.
  • Compare the workload's placement requirement with the worker node's labels.
  • Restore placement on the worker without changing the Deployment and verify readiness.

Lab README

The workload waiting for a node

A cache workload never leaves Pending. Its intended placement is the worker node of this disposable cluster. Investigate scheduler events and restore placement without changing the Deployment.

Before you begin

Use a disposable machine with Bash, Python 3, Docker, kind and kubectl. Docker may download the kind node and workload images. The lab creates a two-node cluster named breakfix-apps-02 and a separate kubeconfig and ownership record under ~/.kube; it does not modify your default kubeconfig or cloud resources. Do not use the lab cluster name for other work. Setup refuses to overwrite an existing cluster or files, and teardown checks the recorded node identities.

Investigate

Run ./setup.sh, then inspect the workload and nodes with the dedicated kubeconfig:

kubectl --kubeconfig "$HOME/.kube/breakfix-apps-02" -n breakfix-apps-02 get pods -o wide
kubectl --kubeconfig "$HOME/.kube/breakfix-apps-02" -n breakfix-apps-02 describe pod -l app=cache
kubectl --kubeconfig "$HOME/.kube/breakfix-apps-02" get nodes --show-labels

In this exercise the worker is the intended destination. Do not remove the workload's scheduling constraint or change its Deployment. After correcting the lab's node configuration, run ./verify.sh and ./teardown.sh. Teardown deletes the lab cluster and its two kubeconfig-related files only when the cluster's recorded node identities still match.

View Markdown source ↗

Get the lab

Download and inspect the installer before running it. It checks the archive's SHA-256 digest and refuses to overwrite an existing lab directory.

curl -fsSLO https://devops.download/labs/apps-02-pending-node-selector.sh
less apps-02-pending-node-selector.sh
bash apps-02-pending-node-selector.sh
cd labs/apps-02-pending-node-selector
./setup.sh

When you've made your changes, run ./verify.sh. Remove lab resources with ./teardown.sh.

Download the archive instead ↗

Need a nudge?

Hint #1

Describe the Pending pod and inspect its FailedScheduling event.

Hint #2

Compare the Deployment's node selector with the worker's labels; keep the workload's placement requirement intact.

Hint #3 · Deep Dive Runbook on opsbreakfix.com

Read the deep dive runbook ↗

Solved it?

Read the Official Root Cause Analysis & Certification Roadmap on opsbreakfix.com

Continue to opsbreakfix.com ↗