Open ryanemerson opened 5 years ago
Not required but I would consider: vi more tar (if I'm not wrong this is required to copy things to/from pod) ps
@rigazilla more
, really? :))
nano
would be the smallest thing we can packageless
lsof
(it can list both sockets and file descriptors)ip
which can list interface addresses and routesps
(Although you can probably use lsof
to get similar results)I see the image already contains:
grep
for filteringcoreutils
contains a bunch of useful stuff like sort
, uniq
, tail
, etcbsdtar
is a tar
replacement that has built-in support for gzip compressionCopying files from a container can be achieved using [docker|podman] cp ...
find
from findutils
unzip
(good for JAR files)We could also provide a little help page that is shown when logging into an interactive shell that tells users how to retrieve information (e.g. ip address show
to list all network interfaces and addresses)
Good idea! I think a help page will be very useful.
Some recipes:
ps -fC java
to get the PID of the java process
ss -t -a
get all TCP sockets
ss -u -a
get all UDP sockets
lsof |grep -v "IPv[46]"
list all open files excluding network sockets
My wishlist:
ss
does what netstat does
Does it dump the routing table (netstat -nr
), too? How about showing multicast groups (netstat -ng
)?
If it does that, no problem, let's minimize what we're adding to an image.
For that, we will use ip
which can print interface, route and memberships
@rigazilla
more
, really? :))
more or less :)
ip route
Shows unicast routes
ip maddress
shows multicast routes
mount
Standard Java tools like: jmap
, jps
, jstack
, …
which
-1 for which
. The command
builtin can do the same job:
command -v java
will output /usr/bin/java
I'm afraid the j*
tools pull in java-1.8.0-openjdk-devel which is huge
Not sure about mount
either: wouldn't you mount additional volumes from outside the container ?
Not sure about
mount
either: wouldn't you mount additional volumes from outside the container ?
Yes, but you can inspect mount points inside the pod, like mounted volumes etc:
mount
I'm afraid the
j*
tools pull in java-1.8.0-openjdk-devel which is huge
How would you inspect java processes, detect deadlocks, or do a memory dump without JMX?
Not sure about
mount
either: wouldn't you mount additional volumes from outside the container ?Yes, but you can inspect mount points inside the pod, like mounted volumes etc: Example of
mount
cat /proc/mounts
returns the same :)
Not sure about
mount
either: wouldn't you mount additional volumes from outside the container ?Yes, but you can inspect mount points inside the pod, like mounted volumes etc: Example of
mount
cat /proc/mounts
returns the same :)
Just learned something new :grin: … yes, you are right!
You can check whether you can connect to an ip:port by using:
(: </dev/tcp/172.17.0.6/11222) &>/dev/null && echo "OPEN" || echo "CLOSED"
Hence, don't think you need ping
Also, we should remember that some environment issues with images on Kubernetes/OpenShift can be debugged by launching a pod that contains all the bells and whistles you need, e.g.:
kubectl run rheltoolbox --image=registry.access.redhat.com/rhel7/rhel-tools --restart=Never --attach -i --tty
This can be useful to do things like: if I have a pod in the same namespace where I'm running X, can I connect to X? What is the name resolved for Y? I've found this useful in the past.
https://github.com/infinispan/infinispan-images/pull/34
For a start. More packages can be added later if required.
We could also provide a little help page that is shown when logging into an interactive shell that tells users how to retrieve information (e.g.
ip address show
to list all network interfaces and addresses)
This has proven to be a PIA with ubi-minimal
and docker, so I'm shelving it for now in favour of a simple entry in the README.md.
The image is based upon
ubi-minimal
in order to reduce it's footprint. Consequently, the image does not have many of the tools that developers are accustomed to when debugging issues. However, additional packages can be installed at image build time.What packages do we require for the most common debugging tasks?