-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouting_helper.template.json
42 lines (40 loc) · 1.07 KB
/
routing_helper.template.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% macro make_route_internal(cluster, options) %}
{% if 'timeout_ms' in options %}
"timeout_ms": {{ options['timeout_ms'] }},
{% endif %}
"retry_policy": {
"retry_on": "{{ options.get('retry_on', 'connect-failure') }}"
},
"cluster": "{{ cluster }}"
{% endmacro %}
{% macro make_route(cluster) %}
{{ make_route_internal(cluster, clusters.get(cluster, {})) }}
{% endmacro %}
{% macro internal_cluster_definition(service, options) %}
"name": "{{ service }}",
"connect_timeout_ms": 250,
"type": "sds",
"lb_type": "least_request",
"features": "http2",
"service_name": "{{ service }}",
{% if 'max_requests' in options %}
"circuit_breakers": {
"default": {
"max_requests": {{ options['max_requests'] }}
}
},
{% endif %}
"health_check": {
"type": "http",
"timeout_ms": 2000,
"interval_ms": 5000,
"interval_jitter_ms": 5000,
"unhealthy_threshold": 2,
"healthy_threshold": 2,
"path": "/healthcheck",
"service_name": "{{ service }}"
},
"outlier_detection": {
"success_rate_stdev_factor": 1900
}
{% endmacro %}