Capturing a network trace in a pod
You will need the pod running as the root user in order to perform these steps. See Running a pod as the root user for more details.
-
Get the name of the pod.
kubectl get pods
-
Start a shell session in the pod. Issue the below command, and make the following substitutions:
kubectl exec -it <podname> --container=<container name> -- bash
podname : The name of the pod.
container_name : is the name of the container. If the pod only has one container you can omit this parameter.
For example, if the pod name is jitsi-74d95d6d49-k5nts and the container name is jigasi, then the resulting command is:
kubectl exec -it jitsi-74d95d6d49-k5nts --container=jigasi --bash
-
Update the repositories by issuing the below command:
apt-get update
-
Install tcpdump by issuing the below command:
apt-get install tcpdump
-
Capture the network data, by issuing the command:
tcpdump -i any -w <filename>.pcap
-
Reproduce the problem.
-
To stop and save the capture press Ctrl+C.
Parent Topic: Troubleshooting Sametime on Kubernetes