Run workloads under the restricted level

  • 14 min
  • 5 steps
  • Security

Steps

0 of 5 done

Read a PodSecurity rejection, harden a Deployment until restricted admits it, fix a container the kubelet refuses to start, and give a node agent a namespace of its own.

  1. Step 1 of 5

    web in payments reports 0 of 2 replicas and has no pods to describe. Find the full reason its pods are refused.

    Checked against what your commands print.

  2. Step 2, not started: Change web until the restricted level admits it. Fix every control the error lists, and make the container's root filesystem read-only as well.

  3. Step 3, not started: toolbox passed admission, yet its pod never starts. Find out who refused it and why, then make it run as UID 65534 without loosening any of its existing settings.

  4. Step 4, not started: Add the warn and audit modes to payments at the restricted level, pinned to the same version as enforce, so a future change to that label is previewed before it rejects anything.

  5. Step 5, not started: log-shipper in node-tools must read the node's /var/log, and baseline refuses it. The namespace holds nothing else. Let it run, and keep users who deploy there warned against the baseline level.

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.