Awesome Open Source
Awesome Open Source

kubectl node-shell

(formerly known as kubectl-enter)

Start a root shell in the node's host OS running.



using krew:

kubectl krew index add kvaps
kubectl krew install kvaps/node-shell

or using curl:

curl -LO
chmod +x ./kubectl-node_shell
sudo mv ./kubectl-node_shell /usr/local/bin/kubectl-node_shell


# Get standard bash shell
kubectl node-shell <node>

# Execute custom command
kubectl node-shell <node> -- echo 123

# Use stdin
cat /etc/passwd | kubectl node-shell <node> -- sh -c 'cat > /tmp/passwd'

# Run oneliner script
kubectl node-shell <node> -- sh -c 'cat /tmp/passwd; rm -f /tmp/passwd'

You need to be able to start privileged containers for that.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Shell (173,234
Kubernetes (24,926
Hosts (17,812
Operating System (15,339
Curl (5,986
Kubectl (2,155
Kubectl Plugins (198
Nsenter (6