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

461 lines
14 KiB
Plaintext
Raw Normal View History

2021-07-13 12:53:59 +00:00
{
"nonce": "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
{
"domains": [
2021-07-13 12:53:59 +00:00
"db.ingress.*",
"db.ingress.*:8080"
2021-07-13 12:53:59 +00:00
],
"name": "db",
"requestHeadersToAdd": [
2021-07-13 12:53:59 +00:00
{
"header": {
"key": "foo",
"value": "bar"
}
},
{
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
}
}
],
"requestHeadersToRemove": [
"qux"
],
"responseHeadersToAdd": [
{
"header": {
"key": "foo",
"value": "bar"
}
},
{
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
}
}
],
"responseHeadersToRemove": [
"qux"
],
"routes": [
{
"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": {
"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": {
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"presentMatch": true
2021-07-13 12:53:59 +00:00
}
],
"prefix": "/"
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": {
"headers": [
2021-07-13 12:53:59 +00:00
{
"invertMatch": true,
"name": "x-debug",
"presentMatch": true
2021-07-13 12:53:59 +00:00
}
],
"prefix": "/"
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": {
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"exact": "exact"
}
2021-07-13 12:53:59 +00:00
}
],
"prefix": "/"
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": {
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"prefix": "prefix"
}
2021-07-13 12:53:59 +00:00
}
],
"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": {
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"suffix": "suffix"
}
2021-07-13 12:53:59 +00:00
}
],
"prefix": "/"
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": {
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": "x-debug",
"stringMatch": {
"safeRegex": {
"regex": "regex"
}
2021-07-13 12:53:59 +00:00
}
}
],
"prefix": "/"
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": {
"headers": [
2021-07-13 12:53:59 +00:00
{
"name": ":method",
"stringMatch": {
"safeRegex": {
"regex": "GET|PUT"
}
2021-07-13 12:53:59 +00:00
}
}
],
"prefix": "/"
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": {
"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",
"stringMatch": {
"safeRegex": {
"regex": "GET|PUT"
}
2021-07-13 12:53:59 +00:00
}
}
],
"prefix": "/"
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": {
"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": {
"numRetries": 15,
"retryOn": "connect-failure"
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": {
"numRetries": 15,
"retryOn": "reset"
}
}
},
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": {
"numRetries": 15,
"retriableStatusCodes": [
2021-07-13 12:53:59 +00:00
401,
409,
451
],
"retryOn": "retriable-status-codes"
2021-07-13 12:53:59 +00:00
}
}
},
{
"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": {
"retriableStatusCodes": [
2021-07-13 12:53:59 +00:00
401,
409,
451
],
"retryOn": "5xx,gateway-error,reset,connect-failure,envoy-ratelimited,retriable-4xx,refused-stream,cancelled,deadline-exceeded,internal,resource-exhausted,unavailable,retriable-status-codes"
2021-07-13 12:53:59 +00:00
}
}
},
{
"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
}
]
2021-07-13 12:53:59 +00:00
}
}
},
{
"match": {
"path": "/header-manip"
},
"requestHeadersToAdd": [
{
"header": {
"key": "request",
"value": "bar"
}
},
{
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
}
}
],
"requestHeadersToRemove": [
"qux"
],
"responseHeadersToAdd": [
{
"header": {
"key": "response",
"value": "bar"
}
},
{
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
}
}
],
"responseHeadersToRemove": [
"qux"
],
"route": {
"cluster": "header-manip.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": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul"
}
2021-07-13 12:53:59 +00:00
}
]
}
]
2021-07-13 12:53:59 +00:00
}
],
"typeUrl": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
"versionInfo": "00000001"
2021-07-13 12:53:59 +00:00
}