Search code examples
envoyproxy

Can I change fault injection configuration envoy proxy at run-time?


I understand that I can configure fault injection in Envoy proxy with the bellow configuration.

config.filter.http.fault.v2.FaultAbort

{
  "http_status": "...",
  "percentage": "{...}"
}

The above code will fail the specified percentage of the requests with the specified http_status, for instance 500.

Now, can I change it at runtime? I would like to insert a fault against a specific service, say, for 10 seconds and then put it back to normal. Is this possible?


Solution

  • Yes, you can change things like this in Envoy during operation through one of two mechanisms:

    1. Hot Restart
    2. Sending Dynamic Configs with xDS

    The hot restart mechanism is much simpler for small deployments, so if this is a small effort or test I would recommend that.

    The xDS option is basically to create a central server that the Envoy proxy connects to. This server then sends all configurations to the proxy however you want. This is far more complicated (needing to create user-interfaces, default configs, service discovery, etc etc etc) but provides many benefits which is why companies and projects have sprung up with their own implementations.