Fault Injection

    FaultInjection policy helps you to test your microservices against resiliency. Kuma provides 3 different types of failures that could be imitated in your environment. These faults are Delay, and ResponseBandwidth limit.

    1. type: FaultInjection
    2. mesh: default
    3. sources:
    4. - match:
    5. kuma.io/service: frontend
    6. version: "0.1"
    7. destinations:
    8. - match:
    9. kuma.io/service: backend
    10. kuma.io/protocol: http
    11. abort:
    12. httpStatus: 500
    13. delay:
    14. percentage: 50.5
    15. value: 5s
    16. responseBandwidth:
    17. limit: 50 mbps
    18. percentage: 50

    FaultInjection is a policy, which is applied to the connection between dataplanes. As most of the policies, FaultInjection supports the powerful mechanism of matching, which allows you to precisely match source and destination dataplanes.

    HTTP Faults

    At least one of the following Faults should be specified.

    Abort

    Abort defines a configuration of not delivering requests to destination service and replacing the responses from destination dataplane by predefined status code.

    • httpStatus - HTTP status code which will be returned to source side
    • percentage - percentage of requests on which abort will be injected, has to be in [0.0 - 100.0] range

    Delay

    • value - the duration during which the response will be delayed
    • percentage - percentage of requests on which delay will be injected, has to be in [0.0 - 100.0] range

    ResponseBandwidth limit

    ResponseBandwidth defines a configuration to limit the speed of responding to the requests.

    • limit - represented by value measure in gbps, mbps, kbps or bps, e.g. 10kbps

    Matching

    FaultInjection is an Inbound Connection Policy. You can use all the tags in both sources and destinations sections.