consul/agent/xds/testdata/routes/ingress-with-chain-and-rout...

468 lines
14 KiB
Plaintext
Raw Normal View History

2021-07-13 12:53:59 +00:00
{
"versionInfo": "00000001",
"resources": [
2021-07-13 12:53:59 +00:00
{
"@type": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
"name": "8080",
"virtualHosts": [
2021-07-13 12:53:59 +00:00
{
"name": "db",
"domains": [
2021-07-13 12:53:59 +00:00
"db.ingress.*",
"db.ingress.*:8080"
2021-07-13 12:53:59 +00:00
],
"routes": [
2021-07-13 12:53:59 +00:00
{
"match": {
"prefix": "/prefix"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "prefix.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"path": "/exact"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "exact.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"safeRegex": {
"googleRe2": {},
"regex": "/regex"
2021-07-13 12:53:59 +00:00
}
},
"route": {
"cluster": "regex.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"presentMatch": true
2021-07-13 12:53:59 +00:00
}
]
},
"route": {
"cluster": "hdr-present.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"presentMatch": true,
"invertMatch": true
2021-07-13 12:53:59 +00:00
}
]
},
"route": {
"cluster": "hdr-not-present.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"exact": "exact"
}
2021-07-13 12:53:59 +00:00
}
]
},
"route": {
"cluster": "hdr-exact.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"prefix": "prefix"
}
2021-07-13 12:53:59 +00:00
}
]
},
"route": {
"cluster": "hdr-prefix.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"suffix": "suffix"
}
2021-07-13 12:53:59 +00:00
}
]
},
"route": {
"cluster": "hdr-suffix.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"safeRegex": {
"googleRe2": {},
"regex": "regex"
}
2021-07-13 12:53:59 +00:00
}
}
]
},
"route": {
"cluster": "hdr-regex.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": ":method",
"safeRegexMatch": {
"googleRe2": {},
"regex": "GET|PUT"
2021-07-13 12:53:59 +00:00
}
}
]
},
"route": {
"cluster": "just-methods.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"exact": "exact"
}
2021-07-13 12:53:59 +00:00
},
{
"name": ":method",
"safeRegexMatch": {
"googleRe2": {},
"regex": "GET|PUT"
2021-07-13 12:53:59 +00:00
}
}
]
},
"route": {
"cluster": "hdr-exact-with-method.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"queryParameters": [
2021-07-13 12:53:59 +00:00
{
"name": "secretparam1",
"stringMatch": {
"exact": "exact"
2021-07-13 12:53:59 +00:00
}
}
]
},
"route": {
"cluster": "prm-exact.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"queryParameters": [
2021-07-13 12:53:59 +00:00
{
"name": "secretparam2",
"stringMatch": {
"safeRegex": {
"googleRe2": {},
"regex": "regex"
2021-07-13 12:53:59 +00:00
}
}
}
]
},
"route": {
"cluster": "prm-regex.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/",
"queryParameters": [
2021-07-13 12:53:59 +00:00
{
"name": "secretparam3",
"presentMatch": true
2021-07-13 12:53:59 +00:00
}
]
},
"route": {
"cluster": "prm-present.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "nil-match.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "empty-match-1.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "empty-match-2.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/prefix"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "prefix-rewrite-1.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"prefixRewrite": "/"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/prefix"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "prefix-rewrite-2.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"prefixRewrite": "/nested/newlocation"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/timeout"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "req-timeout.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"timeout": "33s"
2021-07-13 12:53:59 +00:00
}
},
{
"match": {
"prefix": "/idle-timeout"
},
"route": {
"cluster": "idle-timeout.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"idleTimeout": "33s"
}
},
2021-07-13 12:53:59 +00:00
{
"match": {
"prefix": "/retry-connect"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "retry-connect.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"retryPolicy": {
"retryOn": "connect-failure",
"numRetries": 15
2021-07-13 12:53:59 +00:00
}
}
},
{
"match": {
"prefix": "/retry-reset"
},
"route": {
"cluster": "retry-reset.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"retryPolicy": {
"retryOn": "reset",
"numRetries": 15
}
}
},
2021-07-13 12:53:59 +00:00
{
"match": {
"prefix": "/retry-codes"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "retry-codes.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"retryPolicy": {
"retryOn": "retriable-status-codes",
"numRetries": 15,
"retriableStatusCodes": [
2021-07-13 12:53:59 +00:00
401,
409,
451
]
}
}
},
{
"match": {
"prefix": "/retry-all"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "retry-all.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"retryPolicy": {
"retryOn": "5xx,gateway-error,reset,connect-failure,envoy-ratelimited,retriable-4xx,refused-stream,cancelled,deadline-exceeded,internal,resource-exhausted,unavailable,retriable-status-codes",
"retriableStatusCodes": [
2021-07-13 12:53:59 +00:00
401,
409,
451
]
}
}
},
{
"match": {
"prefix": "/split-3-ways"
2021-07-13 12:53:59 +00:00
},
"route": {
"weightedClusters": {
"clusters": [
2021-07-13 12:53:59 +00:00
{
"name": "big-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"weight": 9550
2021-07-13 12:53:59 +00:00
},
{
"name": "goldilocks-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"weight": 400
2021-07-13 12:53:59 +00:00
},
{
"name": "lil-bit-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"weight": 50
2021-07-13 12:53:59 +00:00
}
],
"totalWeight": 10000
2021-07-13 12:53:59 +00:00
}
}
},
{
"match": {
"path": "/header-manip"
},
"route": {
"cluster": "header-manip.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
},
"requestHeadersToAdd": [
{
"header": {
"key": "request",
"value": "bar"
},
"append": true
},
{
"header": {
"key": "bar",
"value": "baz"
},
"append": false
}
],
"requestHeadersToRemove": [
"qux"
],
"responseHeadersToAdd": [
{
"header": {
"key": "response",
"value": "bar"
},
"append": true
},
{
"header": {
"key": "bar",
"value": "baz"
},
"append": false
}
],
"responseHeadersToRemove": [
"qux"
]
},
2021-07-13 12:53:59 +00:00
{
"match": {
"prefix": "/"
2021-07-13 12:53:59 +00:00
},
"route": {
"cluster": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
2021-07-13 12:53:59 +00:00
}
}
],
"requestHeadersToAdd": [
2021-07-13 12:53:59 +00:00
{
"header": {
"key": "foo",
"value": "bar"
2021-07-13 12:53:59 +00:00
},
"append": true
2021-07-13 12:53:59 +00:00
},
{
"header": {
"key": "bar",
"value": "baz"
2021-07-13 12:53:59 +00:00
},
"append": false
2021-07-13 12:53:59 +00:00
}
],
"requestHeadersToRemove": [
2021-07-13 12:53:59 +00:00
"qux"
],
"responseHeadersToAdd": [
2021-07-13 12:53:59 +00:00
{
"header": {
"key": "foo",
"value": "bar"
2021-07-13 12:53:59 +00:00
},
"append": true
2021-07-13 12:53:59 +00:00
},
{
"header": {
"key": "bar",
"value": "baz"
2021-07-13 12:53:59 +00:00
},
"append": false
2021-07-13 12:53:59 +00:00
}
],
"responseHeadersToRemove": [
2021-07-13 12:53:59 +00:00
"qux"
]
}
],
"validateClusters": true
2021-07-13 12:53:59 +00:00
}
],
"typeUrl": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
"nonce": "00000001"
2021-07-13 12:53:59 +00:00
}