-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: hejianpeng <[email protected]>
- Loading branch information
Showing
6 changed files
with
242 additions
and
1 deletion.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
http: | ||
- name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
routes: | ||
- name: "first-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "one" | ||
limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/bar" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 | ||
- name: "second-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
distinct: true | ||
limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "example" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 | ||
- name: "third-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "test" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 |
62 changes: 62 additions & 0 deletions
62
internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
- commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
name: first-route | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS | ||
- commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
name: second-route | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS | ||
- commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
name: third-route | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS | ||
- commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
dnsRefreshRate: 30s | ||
loadAssignment: | ||
clusterName: ratelimit_cluster | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: envoy-ratelimit.envoy-gateway-system.svc.example-cluster.local | ||
portValue: 8081 | ||
loadBalancingWeight: 1 | ||
locality: {} | ||
name: ratelimit_cluster | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
respectDnsTtl: true | ||
type: STRICT_DNS | ||
typedExtensionProtocolOptions: | ||
envoy.extensions.upstreams.http.v3.HttpProtocolOptions: | ||
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions | ||
explicitHttpConfig: | ||
http2ProtocolOptions: {} |
30 changes: 30 additions & 0 deletions
30
internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
- clusterName: first-route | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 1.2.3.4 | ||
portValue: 50000 | ||
loadBalancingWeight: 1 | ||
locality: {} | ||
- clusterName: second-route | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 1.2.3.4 | ||
portValue: 50000 | ||
loadBalancingWeight: 1 | ||
locality: {} | ||
- clusterName: third-route | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 1.2.3.4 | ||
portValue: 50000 | ||
loadBalancingWeight: 1 | ||
locality: {} |
50 changes: 50 additions & 0 deletions
50
internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.listeners.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
- accessLog: | ||
- filter: | ||
responseFlagFilter: | ||
flags: | ||
- NR | ||
name: envoy.access_loggers.file | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog | ||
path: /dev/stdout | ||
address: | ||
socketAddress: | ||
address: 0.0.0.0 | ||
portValue: 10080 | ||
defaultFilterChain: | ||
filters: | ||
- name: envoy.filters.network.http_connection_manager | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
accessLog: | ||
- name: envoy.access_loggers.file | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog | ||
path: /dev/stdout | ||
httpFilters: | ||
- name: envoy.filters.http.ratelimit | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit | ||
domain: first-listener | ||
rateLimitService: | ||
grpcService: | ||
envoyGrpc: | ||
clusterName: ratelimit_cluster | ||
transportApiVersion: V3 | ||
- name: envoy.filters.http.router | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
mergeSlashes: true | ||
normalizePath: true | ||
pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT | ||
rds: | ||
configSource: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
routeConfigName: first-listener | ||
statPrefix: http | ||
upgradeConfigs: | ||
- upgradeType: websocket | ||
useRemoteAddress: true | ||
name: first-listener | ||
perConnectionBufferLimitBytes: 32768 |
41 changes: 41 additions & 0 deletions
41
internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
- name: first-listener | ||
virtualHosts: | ||
- domains: | ||
- '*' | ||
name: first-listener | ||
routes: | ||
- match: | ||
path: foo/bar | ||
name: first-route | ||
route: | ||
cluster: first-route | ||
rateLimits: | ||
- actions: | ||
- headerValueMatch: | ||
descriptorKey: first-route-key-rule-0-match-0 | ||
descriptorValue: first-route-value-rule-0-match-0 | ||
expectMatch: true | ||
headers: | ||
- name: x-user-id | ||
stringMatch: | ||
exact: one | ||
- match: | ||
path: example | ||
name: second-route | ||
route: | ||
cluster: second-route | ||
rateLimits: | ||
- actions: | ||
- requestHeaders: | ||
descriptorKey: second-route-key-rule-0-match-0 | ||
headerName: x-user-id | ||
- match: | ||
path: test | ||
name: third-route | ||
route: | ||
cluster: third-route | ||
rateLimits: | ||
- actions: | ||
- genericKey: | ||
descriptorKey: third-route-key-rule-0-match--1 | ||
descriptorValue: third-route-value-rule-0-match--1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters