Skip to content

Instantly share code, notes, and snippets.

@nbrandaleone
Created February 26, 2020 19:45
Show Gist options
  • Select an option

  • Save nbrandaleone/dd643f03f9b9371fb69238784a448d5a to your computer and use it in GitHub Desktop.

Select an option

Save nbrandaleone/dd643f03f9b9371fb69238784a448d5a to your computer and use it in GitHub Desktop.
[Access your Kubernetes nodes] #kubernetes

$ curl -LO https://github.com/kvaps/kubectl-node-shell/raw/master/kubectl-node_shell $ chmod +x ./kubectl-node_shell $ sudo mv ./kubectl-node_shell /usr/local/bin/kubectl-node_shell

$ kubectl node-shell ip-192-168-31-163.us-west-2.compute.internal spawning "nsenter-6t2mg4" on "ip-192-168-31-163.us-west-2.compute.internal" If you don't see a command prompt, try pressing enter. [root@ip-192-168-31-163 /]# ifconfig -a eni2b71a27c699: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 inet6 fe80::fcb5:7ff:fe67:10fc prefixlen 64 scopeid 0x20 ether fe:b5:07:67:10:fc txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 7 bytes 586 (586.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 inet 192.168.31.163 netmask 255.255.224.0 broadcast 192.168.31.255 inet6 fe80::470:adff:fe36:3adc prefixlen 64 scopeid 0x20 ether 06:70:ad:36:3a:dc txqueuelen 1000 (Ethernet) RX packets 131220 bytes 180878458 (172.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 27534 bytes 2171248 (2.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether 06:62:43:20:75:d2 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 719 bytes 52940 (51.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 719 bytes 52940 (51.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@ip-192-168-31-163 /]# exit logout Session ended, resume using 'kubectl attach nsenter-6t2mg4 -c nsenter -i -t' command when the pod is running pod "nsenter-6t2mg4" deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment