xk6-disruptor
xk6-disruptor copied to clipboard
Automatically exclude liveness/readiness probe endpoints
It is common to add exclusions for liveness/readiness endpoints to the test config, as not doing so may cause probes to fail and the pod to be removed from the service load balancer, or even restarted:
const fault = {
// ...
exclude: '/health,/ready',
};
However, it might not be immediately obvious to application developers why this needs to be done. As http readiness/liveness probes are defined in the pod spec, it should be possible for the disruptor to check for any http probes present in this spec, and automatically feed them to the proxy.
Proposal
We can make a change in the agent so that, by default, bypasses all requests that include an User-Agent
header that starts with kube-probe
.
As there can be some cases where we do want for probes to be disrupted, we can add an option to opt-out of this behavior:
{
includeProbes: true, // Defaults to false.
}