Point kubectl at a namespace and preview a change

  • 14 min
  • 7 steps
  • The API and the loop

Steps

0 of 7 done

Set a default namespace on your context, pull exact fields out of objects, scaffold a manifest with a generator, and use a server dry run and a diff before and after you apply it.

  1. Step 1 of 7

    Everything in this lab lives in shop. Make shop the default namespace of your current context, then confirm the context shows it.

    Checked against what your commands print.

  2. Step 2, not started: List the pods in shop as a two-column table: the pod name under NAME and the node it runs on under NODE.

  3. Step 3, not started: Print only the image the frontend Deployment's container runs, with nothing else around it.

  4. Step 4, not started: Write a manifest for a Deployment named cache running redis:8.8 into cache.yaml, without creating anything in the cluster. Show the file.

  5. Step 5, not started: Have the API server check cache.yaml through admission and validation without storing it.

  6. Step 6, not started: Create cache in shop from the file and wait for it to become available.

  7. Step 7, not started: Scale cache to three replicas by command, then show what applying cache.yaml again would change.

Lab terminal

Cluster time 50 seconds
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.