On top of that, I usually work on metrics collection, visualization and load testing in a staging k8s cluster, in which it would be rather tedious to set up tc rules on the worker nodes themselves (or even impossible in the case of managed K8s services with no direct access to the VMs acting as worker nodes).
How you do it with tc:
- set up dedicated network namespacel, with veth configured well
- the veth on host should do forwarding and NAT/masquerade
- Add TC either on veth inside ns or veth on host, or both (depending on direction you want to add latency)
- then wait
- then change the tc parameters if you want the parameters to change
Now, the big problem with tc netem variable latency is that it does reorder packets, which is often undesirable.
So, if your project does _not_ effect in packet reorder, it could be useful. Having said that, it seems to focus on L7 layer which is slightly too high level for the stuff I 'm doing.
Anyway, nice tool.
Replace add with `del` to remove it.
See `man netem` for more. It also allows you to specify distribution, and simulate other network issues — packet loss, reordering, data corruption. For example: