• Skip to primary navigation
  • Skip to main content
Alexandre Vazquez
  • Home
  • TIBCO
    • TIBCO BusinessWorks
    • Flogo
    • TIBFAQS
  • Architecture
    • API
    • Security
    • Integration
    • Event Processing
  • Kubernetes
  • Monitoring
    • Observability
    • Prometheus
    • Log Aggregation
      • Loki
  • Service Mesh
    • Istio
  • Helm
  • Editorial
  • About Me

How To Troubleshoot Network Connections On Your Kubernetes Workloads

Published on 2022-04-04. Last Updated on 2022-05-06 by Alexandre Vazquez

Discover Mizu: Traffic Viewer for Kubernetes to ease this challenge and improve your daily work.

How To Troubleshoot Network Connections On Your Kubernetes Workloads

Photo by Jordan Harrison on Unsplash

One of the most common things we have to do when testing and debugging our cloud-native workloads on Kubernetes is to check the network communication.

It could be to check the incoming traffic you are getting so we can inspect the requests we are receiving and see what we are replying to and similar kinds of use-cases. I am sure this sounds familiar to most of you.

I usually solve that using tcpdump on the container, similar to what I would do in a traditional environment, but this is not always easy. Depending on the environment and configuration, you cannot do so because you need to include a new package in your container image, do a new deployment, so it is available, etc.

So, to solve that and other similar problems, I discovered a tool named Mizu, which I would like to have found a few months ago because it would help me a lot. Mizu is precisely that. In its own words:

Mizu is a simple-yet-powerful API traffic viewer for Kubernetes, enabling you to view all API communication between microservices across multiple protocols to help you debug and troubleshoot regressions.

How To Troubleshoot Network Connections On Your Kubernetes Workloads
Mizu – API Traffic viewer for Kubernetes
A simple-yet-powerful API traffic viewer for Kubernetes to help you troubleshoot and debug your microservices. Think TCPDump and Chrome Dev Tools combined.

To install, it is pretty straightforward. You need to grab the binary and provide the correct permission on your computer. You have a different binary for each architecture, and in my case (Mac Intel-based), these are the commands that I executed:

curl -Lo mizu github.com/up9inc/mizu/releases/latest/download/mizu_darwin_amd64 && chmod 755 mizu && mv mizu /usr/local/bin

And that’s it, then you have a binary in your laptop that connects to your Kubernetes cluster using Kubernetes API, so you need to have configured the proper context.

In my case, I have deployed a simple nginx server using the command:

 kubectl run simple-app --image=nginx --port 80

And once that the component has been deployed, as it is shown in the Lens screenshot below:

I ran the command to launch mizu from my laptop:

mizu tap

And after a few seconds, I have in front of me a webpage opened monitoring all traffic happening in this pod:

How To Troubleshoot Network Connections On Your Kubernetes Workloads
How To Troubleshoot Network Connections On Your Kubernetes Workloads 11

I have made the nginx port expose using the kubectl expose command:

 kubectl expose pod/simple-app

And after that, I deployed a temporary pod using the curl image to start sending some requests with the command shown below:

 kubectl run -it --rm --image=curlimages/curl curly -- sh

now I’ve started to send some requests to my nginx pod using curl:

 curl -vvv http://simple-app:80 

And after a few calls, I could see a lot of information in front of me. First of all, I can see the requests I was sending with all the details of it:

How To Troubleshoot Network Connections On Your Kubernetes Workloads
How To Troubleshoot Network Connections On Your Kubernetes Workloads 12

But even more important, I can see a service map diagram showing the dependencies and the calls graphically happening to the pod with the response time and also the protocol usage:

How To Troubleshoot Network Connections On Your Kubernetes Workloads
How To Troubleshoot Network Connections On Your Kubernetes Workloads 13

This will not certainly replace a complete observability solution on top of a service mesh. Still, it will be a beneficial tool to add to your toolchain when you need to debug a specific communication between components or similar kinds of scenarios. As commented, it is like a high-level tcpdump for pod communication.

If you find this content interesting please think about making a contribution using the button below to keep this content updated and increased!


Related articles:

Kubernetes Autoscaling: Learn How To Scale Your Kubernetes Deployments DynamicallyKubernetes Autoscaling: Learn How to Scale Your Kubernetes Deployments Dynamically #Tibfaqs Enabling Remote Debugging For Tibco Businessworks Application On Kubernetes#TIBFAQS Enabling Remote Debugging for TIBCO BusinessWorks Application on Kubernetes Integrating Istio With Bwce ApplicationsIntegrating Istio with BWCE Applications

Copyright © 2023 · Custom on Genesis Framework · WordPress · Log in