Select, filter and scope

  • 12 min
  • 5 steps
  • The API and the loop

Steps

0 of 5 done

Read labels, write a set-based selector, clean up with a field selector, repair a namespace selector that matches nothing, and retire a canary by label.

  1. Step 1 of 5

    The shop namespace runs a storefront, a canary of it, a cache and two finished seed pods. List the pods in shop together with their labels, and find the label that tells the canary apart.

    Checked against what your commands print.

  2. Step 2, not started: With one label selector, list only the storefront pods (app.kubernetes.io/name=web) in shop that are not canaries.

  3. Step 3, not started: The two seed pods finished long ago. Delete every pod in shop whose phase is Succeeded, with one command that does not name them.

  4. Step 4, not started: The prober in the monitoring namespace cannot reach http://web.shop.svc.cluster.local/, although the NetworkPolicy web-from-monitoring in shop is meant to allow it. Find why its namespace selector matches nothing, and fix the policy so that the prober gets through.

  5. Step 5, not started: The canary is done. Delete every Deployment in shop that carries the canary's track label, with one command that selects by label, and leave the stable storefront running.

Lab terminal

Cluster time 1 minute
kind cluster kx, Kubernetes 1.37.
Each step is checked as you work.
​
Tab completes. Up and Down recall.
Type help for more.
Terminal keys

Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.