Access to kubernetes node via nsenter
, similar with kubectl debug
but more powerful
wget https://raw.githubusercontent.com/qingwave/kube-nodeshell/main/kube-nodeshell.sh
chmod +x ./kube-nodeshell.sh
# [optional] install kubectl plugin, make sure /usr/local/bin in your PATH
sudo mv ./kube-nodeshell.sh /usr/local/bin/kubectl-nodeshell
You can use the script kube-nodeshell.sh
directly, or use kubectl plugin kubectl nodeshell
Access to a special node temporarily, will create a pod and exec into it
kubectl nodeshell {node_name}
Install kube-nodeshell daemonset on all node for frequently used
# install daemonset
kubectl nodeshell -i
# access to node
kubectl nodeshell {node_name}
Others:
kubectl nodeshell -h