The first problem to overcome is the availability of the tcpdump command in the Kubernetes pod. In this article, I'll be using the KIE Server (execution server) of the Red Hat Process Automation Manager product as an example, but this approach should work with any kind of containerized application. This PCAP file can then be loaded in a tool like Wireshark to analyze the traffic and, in this case, the RESTful communication of a service running in a pod. We will be using tcpdump to capture a so-called, PCAP (packet capture) file that will contain the pod's network traffic. It's an easy way to capture network traffic data between Kubernetes/ OpenShift pods, allowing developers to better analyze and debug communication problems in containerized applications and to solve issues quicker and more effectively. In the last couple of months, I've tried various approaches to overcome this problem, which resulted in the approach that I'll outline in this article. This makes debugging and analyzing network traffic between containers and, thus, debugging of inter-microservice communication a bit harder than in the non-containerized world. This means that a tool like tcpdump is usually not available in a container. A second problem is that, in compliance with container design best practices, containers contain only the minimal set of applications and libraries needed to execute their task. However, this method of debugging does not work well in a containerized world.įirst of all, the containers most likely run on an internal container platform network that is not directly accessible by your machine. In the world of distributed computing, containers, and microservices, a lot of the interactions and communication between services is done via RESTful APIs. While developing these APIs and interactions between services, I often have the need to debug the communication between services, especially when things don't seem to work as expected.īefore the world of containers, I would simply deploy my services on my local machine, start up Wireshark, execute my tests, and analyze the HTTP communication between my services. This for me has always been an easy and effective way to quickly analyze communication problems in my software.
0 Comments
Leave a Reply. |