...
1 package profiles
2
3
4 const Template = `### ServiceProfile for {{.ServiceName}}.{{.ServiceNamespace}} ###
5 apiVersion: linkerd.io/v1alpha2
6 kind: ServiceProfile
7 metadata:
8 name: {{.ServiceName}}.{{.ServiceNamespace}}.svc.{{.ClusterDomain}}
9 namespace: {{.ServiceNamespace}}
10 spec:
11 # A service profile defines a list of routes. Linkerd can aggregate metrics
12 # like request volume, latency, and success rate by route.
13 routes:
14 - name: '/authors/{id}'
15
16 # Each route must define a condition. All requests that match the
17 # condition will be counted as belonging to that route. If a request
18 # matches more than one route, the first match wins.
19 condition:
20 # The simplest condition is a path regular expression.
21 pathRegex: '/authors/\d+'
22
23 # This is a condition that checks the request method.
24 method: POST
25
26 # If more than one condition field is set, all of them must be satisfied.
27 # This is equivalent to using the 'all' condition:
28 # all:
29 # - pathRegex: '/authors/\d+'
30 # - method: POST
31
32 # Conditions can be combined using 'all', 'any', and 'not'.
33 # any:
34 # - all:
35 # - method: POST
36 # - pathRegex: '/authors/\d+'
37 # - all:
38 # - not:
39 # method: DELETE
40 # - pathRegex: /info.txt
41
42 # A route may be marked as retryable. This indicates that requests to this
43 # route are always safe to retry and will cause the proxy to retry failed
44 # requests on this route whenever possible.
45 # isRetryable: true
46
47 # A route may optionally define a list of response classes which describe
48 # how responses from this route will be classified.
49 responseClasses:
50
51 # Each response class must define a condition. All responses from this
52 # route that match the condition will be classified as this response class.
53 - condition:
54 # The simplest condition is a HTTP status code range.
55 status:
56 min: 500
57 max: 599
58
59 # Specifying only one of min or max matches just that one status code.
60 # status:
61 # min: 404 # This matches 404s only.
62
63 # Conditions can be combined using 'all', 'any', and 'not'.
64 # all:
65 # - status:
66 # min: 500
67 # max: 599
68 # - not:
69 # status:
70 # min: 503
71
72 # The response class defines whether responses should be counted as
73 # successes or failures.
74 isFailure: true
75
76 # A route can define a request timeout. Any requests to this route that
77 # exceed the timeout will be canceled. If unspecified, the default timeout
78 # is '10s' (ten seconds).
79 # timeout: 250ms
80
81 # A service profile can also define a retry budget. This specifies the
82 # maximum total number of retries that should be sent to this service as a
83 # ratio of the original request volume.
84 # retryBudget:
85 # The retryRatio is the maximum ratio of retries requests to original
86 # requests. A retryRatio of 0.2 means that retries may add at most an
87 # additional 20% to the request load.
88 # retryRatio: 0.2
89
90 # This is an allowance of retries per second in addition to those allowed
91 # by the retryRatio. This allows retries to be performed, when the request
92 # rate is very low.
93 # minRetriesPerSecond: 10
94
95 # This duration indicates for how long requests should be considered for the
96 # purposes of calculating the retryRatio. A higher value considers a larger
97 # window and therefore allows burstier retries.
98 # ttl: 10s
99 `
100
View as plain text