kubectl run tmp-shell —rm -i —tty —image nicolaka/netshoot — /bin/bash
kubectl run —generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run —generator=run-pod/v1 or kubectl create instead.
If you don’t see a command prompt, try pressing enter.
bash-5.0# ls -al
total 8
drwxr-xr-x 1 root root 17 Nov 30 09:31 .
drwxr-xr-x 1 root root 17 Nov 30 09:31 ..
-rwxr-xr-x 1 root root 0 Nov 30 09:31 .dockerenv
drwxr-xr-x 1 root root 220 Jul 13 18:41 bin
drwxr-xr-x 5 root root 380 Nov 30 09:31 dev
drwxr-xr-x 1 root root 66 Nov 30 09:31 etc
drwxr-xr-x 2 root root 6 Apr 23 2020 home
drwxr-xr-x 1 root root 4096 Jul 13 18:41 lib
drwxr-xr-x 2 root root 34 Jul 13 18:41 lib64
drwxr-xr-x 5 root root 44 Apr 23 2020 media
drwxr-xr-x 2 root root 6 Apr 23 2020 mnt
drwxr-xr-x 2 root root 6 Apr 23 2020 opt
dr-xr-xr-x 300 root root 0 Nov 30 09:31 proc
drwx——— 2 root root 6 Apr 23 2020 root
drwxr-xr-x 1 root root 21 Nov 30 09:31 run
drwxr-xr-x 1 root root 4096 Jul 13 18:41 sbin
drwxr-xr-x 2 root root 6 Apr 23 2020 srv
dr-xr-xr-x 13 root root 0 Nov 30 09:31 sys
drwxrwxrwt 2 root root 6 Apr 23 2020 tmp
drwxr-xr-x 1 root root 19 Jul 13 18:41 usr
drwxr-xr-x 1 root root 54 Jul 13 18:40 var
bash-5.0# calicoctl
Usage:
calicoctl [options] […]
Invalid option: ‘calicoctl ‘. Use flag ‘—help’ to read about a specific subcommand.
bash-5.0# calicoctl ls
Unknown command: “ls”
Usage:
calicoctl [options] […]
docker tag nicolaka/netshoot registry.cn-hangzhou.aliyuncs.com/tscswcn/cloud:tools
docker login registry.cn-hangzhou.aliyuncs.com
docker push registry.cn-hangzhou.aliyuncs.com/tscswcn/cloud:tools
在docker 里使用
docker run -it —net container:
这个tools 包含
apache2-utils
bash
bind-tools
bird
bridge-utils
busybox-extras
calicoctl
conntrack-tools
ctop
curl
dhcping
drill
ethtool
file
fping
httpie
iftop
iperf
iproute2
ipset
iptables
iptraf-ng
iputils
ipvsadm
jq
libc6-compat
liboping
mtr
net-snmp-tools
netcat-openbsd
netgen
nftables
ngrep
nmap
nmap-nping
openssl
py-crypto
py2-virtualenv
python2
scapy
socat
strace
tcpdump
tcptraceroute
termshark
tshark
util-linux
vim
websocat