Container image for debugging Alibaba Cloud ACK clusters
After building the image and pushing to a repository, quickly spin up a pod debug
with the given image which does nothing but sleep infinity
. Assume the image is called debug
, with REG_HOSTNAME
, REG_NAMESPACE
and IMG_TAG
set accordingly.
kubectl run debug --image="$REG_HOSTNAME/$REG_NAMESPACE/debug:$IMG_TAG"
Now, to test network-related stuff within the cluster, it suffices to spawn a shell inside the pod and utilize common networking tools such as ping
, curl
and dig
. The following packages have been pre-installed:
which
: provideswhich
command for quickly checking whether a command is availablebind-utils
: providesdig
for DNS queriesiputils
: providesping
for ICMP ping
kubectl exec -it debug -- /bin/bash
Note that the image is based on Alibaba Cloud Linux which uses package mirrors and repositories only available within Alibaba Cloud, so it can only be built and used inside Alibaba Cloud, e.g. built within an ECS instance and deployed to an ACK cluster.
Build the image as usual using Docker, Podman or otherwise. Assuming Docker is used:
docker build -t debug .