Orphans, adoption and a stuck namespace
- 12 min
- 6 steps
- The API and the loop
Steps
0 of 6 done
Trace who owns the pods of a Deployment, replace the Deployment without restarting a single pod, then find and release the finalizer that holds a namespace in Terminating.
Step 1 of 6
The
ordersnamespace runs a Deployment calledapi. Find out which object controls eachapipod, by kind and name.Checked against what your commands print.
Step 2, not started: The
apiDeployment must be recreated fromapi.yaml, but the pods serve live traffic. Delete the Deployment so that its ReplicaSet and pods keep running.Step 3, not started: Recreate the Deployment from
api.yaml. Check the pod names and ages afterwards: the Deployment should adopt the ReplicaSet you left behind rather than replace the pods.Step 4, not started: The
scratchnamespace held a one-off export job and is no longer needed. Delete it without waiting for the deletion to finish.Step 5, not started: Minutes later
scratchis still Terminating. Find the object that remains inside it and the finalizer that holds it.Step 6, not started: The controller that owned
example.com/upload-reportwas uninstalled long ago, and the export it guarded is not needed. Remove that finalizer, and only that one, so the namespace can finish deleting.
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.