Skip to content

Instantly share code, notes, and snippets.

@schwabix
Last active December 19, 2024 16:44
Show Gist options
  • Select an option

  • Save schwabix/c69def14513a3bf5b7b1233ee3830e61 to your computer and use it in GitHub Desktop.

Select an option

Save schwabix/c69def14513a3bf5b7b1233ee3830e61 to your computer and use it in GitHub Desktop.
How to enter a Kubernetes pod as root
# identify containername
crictl -r unix:///run/containerd/containerd.sock ps
# get full container id
runc --root /run/containerd/runc/k8s.io/ list | grep xxxxxxx
# enter container as root
runc --root /run/containerd/runc/k8s.io/ exec -t -u 0 xxxxxxx sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment