├── README.md ├── kubectl-node_shell └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # kubectl node-shell 2 | *(formerly known as **kubectl-enter**)* 3 | 4 | Start a root shell in the node's host OS running. 5 | 6 | ## Installation 7 | 8 | ``` 9 | curl -LO https://github.com/kvaps/kubectl-node-shell/raw/master/kubectl-node_shell 10 | chmod +x ./kubectl-node_shell 11 | sudo mv ./kubectl-node_shell /usr/local/bin/kubectl-node_shell 12 | ``` 13 | 14 | ## Usage 15 | 16 | ``` 17 | kubectl node-shell 18 | ``` 19 | 20 | *You need to be able to start privileged containers for that.* 21 | -------------------------------------------------------------------------------- /kubectl-node_shell: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -z "$1" ]; then 3 | echo "Please specify node name" 4 | exit 1 5 | fi 6 | 7 | NODE="$1" 8 | IMAGE="alpine" 9 | POD="nsenter-$(env LC_ALL=C tr -dc a-z0-9 < /dev/urandom | head -c 6)" 10 | NAMESPACE="" 11 | 12 | # Check the node 13 | kubectl get node "$NODE" >/dev/null || exit 1 14 | 15 | OVERRIDES="$(cat <