Home > Blockchain >  How to emulate slow socket for HTTP request in kubernetes environment?
How to emulate slow socket for HTTP request in kubernetes environment?

Time:09-23

I need to reproduce the case when the one service in k8s because of pure resource management acts as the slow socket attack and thus causing the wrong and unexpected behavior to another service, not handling this slow socket response/requests well. But currently it is impossible to to put the slow socket service into that state on demand. To debug and verify I need to put something working as a controlled slow socket proxy (traffic speed lowering, delays, introducing timeouts and so on) between the services of interest. Is there some out-of-box solution to be deployed to k8s to work as a slow socket proxy?

CodePudding user response:

Kubernetes does not provide a built-in functionality to test against what you mention.

Instead, the failure you mentioned can be tested against with 3rd party tools. One tool you can use is Litmus Chaos. It is an application designed with chaos engineering principle.

Inside Litmus Chaos, different "chaos" are defined as an experiment. There are a number of built-in experiments you can use. One experiemnt is called Pod Network Latency as documented here.

As you have not provided the pod spec, I cannot help you to construct the experiment YAML. You can refer to the doc and build your "test case" after installation of Litmus Chaos.

  • Related