Add Support for Crunchy PostgreSQL Service, Implement Ingress Traffic Manipulation, add Rate Limiting via Netem, Option to use containerd instead of runc #7
Crunchy PostgreSQL Service has services that follow the pattern of postgresql-11-odb. Seems like a reasonable assumption that the needed values in the services yaml will be the same across the versions, so chose to cover all postgresql-\d+-odb with a single pattern.
One of the setup commands is sudo modprobe ifb ... leaving this module loaded seems relatively harmless compared to unloading it in the case that we were not the ones who loaded it (as in, someone/thing else is depending on it being loaded) so I opted to leave it loaded rather than try to undo that during the unmanipulate_traffic method.
Same deal as the above when it comes to the ifb0 interface being up. harmless to leave up, but harmful to take down if someone else is depending on it.
TBH, I am open to disagreement on these two points though.
Finally, I also added rate limiting via netem to the manipulate_traffic method. This should be nice since it says that the shape traffic can not happen at the same time as manipulate_traffic but this will allow the insertion of throughput limiting alongside other traffic manipulations like latency, loss, etc.
Based on the PCF release notes here: https://docs.pivotal.io/pivotalcf/2-6/pcf-release-notes/runtime-rn.html ... in newer releases, containerd is used instead of runc. I added the ability to use containerd to get a shell / execute commands on a container which can be enabled via a use-containerd entry in the config. this is disabled by default so will not effect behavior unless you choose to.
@karunchennuri let me know what you think of all of this. slightly more involved than the previous PRs, but I believe in all cases backwards compatibility is preserved and the tool is improved some.
Crunchy PostgreSQL Service has services that follow the pattern of
postgresql-11-odb
. Seems like a reasonable assumption that the needed values in the services yaml will be the same across the versions, so chose to cover allpostgresql-\d+-odb
with a single pattern.The approach for implementing ingress traffic manipulation was almost entirely copied from here: https://wiki.linuxfoundation.org/networking/netem#how_can_i_use_netem_on_incoming_traffic
The only notes with that are:
sudo modprobe ifb
... leaving this module loaded seems relatively harmless compared to unloading it in the case that we were not the ones who loaded it (as in, someone/thing else is depending on it being loaded) so I opted to leave it loaded rather than try to undo that during theunmanipulate_traffic
method.ifb0
interface being up. harmless to leave up, but harmful to take down if someone else is depending on it.Finally, I also added rate limiting via netem to the
manipulate_traffic
method. This should be nice since it says that the shape traffic can not happen at the same time asmanipulate_traffic
but this will allow the insertion of throughput limiting alongside other traffic manipulations like latency, loss, etc.Based on the PCF release notes here: https://docs.pivotal.io/pivotalcf/2-6/pcf-release-notes/runtime-rn.html ... in newer releases,
containerd
is used instead ofrunc
. I added the ability to usecontainerd
to get a shell / execute commands on a container which can be enabled via ause-containerd
entry in the config. this is disabled by default so will not effect behavior unless you choose to.