Per-Request Policy
Retries and timeouts can be configured by annotating Service, HTTPRoute, or GRPCRoute resources. This will apply the retry or timeout policy to all requests that are sent to that service/route.
Additionally, retry and timeout policy can be configured for individual HTTP requests by adding special HTTP headers to those requests.
Enabling Per-Request Policy
In order to enable per-request policy, Linkerd must be installed with the
--set policyController.additionalArgs="--allow-l5d-request-headers"
flag or
the corresponding Helm value. Enabling per-request policy is not
recommended if your application accepts requests from untrusted sources (e.g.
if it is an ingress) since this allows untrusted clients to specify Linkerd
policy.
Per-Request Policy Headers
Once per-request policy is enabled, the following HTTP headers can be added to a request to set or override retry and/or timeout policy for that request:
l5d-retry-http
: Overrides theretry.linkerd.io/http
annotationl5d-retry-grpc
: Overrides theretry.linkerd.io/grpc
annotationl5d-retry-limit
: Overrides theretry.linkerd.io/limit
annotationl5d-retry-timeout
: Overrides theretry.linkerd.io/timeout
annotationl5d-timeout
: Overrides thetimeout.linkerd.io/request
annotationl5d-response-timeout
: Overrides thetimeout.linkerd.io/response
annotation