Anyway to install packages in the etcd container for troubleshooting

I built a kubernets cluster on centos using docker-ce, kubelet, kubeadmin, kubectl

In order to trace a issue, I would like to install some packages in the etcd container.

I know the etcd

I used
“kubectl exec -it etcd-ip-10-161-136-29.ec2.internal -n kube-system sh” and get into the container.

I need to install tcpdump or strace inside the container, but I don’t know how to install the packages, as I cannot figure out what flavor linux the etcd is running on…

inside the container, uname -a gives:

/bin # uname -a
Linux ip-10-161-136-29.ec2.internal 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 2018 x86_64 GNU/Linux

the etcd imsage is image: k8s.gcr.io/etcd:3.3.10

Does anyone know which flavor of linux it is?

I found the info from the kubernetes etcd Dockerfile…

The BASEIMAGE is derived from the Makefile

It’s based off busybox.

You might be better off doing it from the host though – if you used kubeadm to provision it, the container has host networking and you can use tcpdump as normal.

Same sort of thing for strace. You can get the pid of the process and use strace from the host without too much trouble. :slight_smile: