-
Notifications
You must be signed in to change notification settings - Fork 360
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: Edoardo Vacchi <evacchi@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
302 additions
and
14 deletions.
There are no files selected for viewing
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
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
69 changes: 69 additions & 0 deletions
69
internal/xds/translator/testdata/in/xds-ir/ratelimit-disable-headers.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,69 @@ | ||
http: | ||
- name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
path: | ||
mergeSlashes: true | ||
escapedSlashesAction: UnescapeAndRedirect | ||
headers: | ||
disableRateLimitHeaders: true | ||
routes: | ||
- name: "first-route" | ||
hostname: "*" | ||
traffic: | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "one" | ||
limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/bar" | ||
destination: | ||
name: "first-route-dest" | ||
settings: | ||
- endpoints: | ||
- host: "1.2.3.4" | ||
port: 50000 | ||
- name: "second-route" | ||
hostname: "*" | ||
traffic: | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
distinct: true | ||
limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "example" | ||
destination: | ||
name: "second-route-dest" | ||
settings: | ||
- endpoints: | ||
- host: "1.2.3.4" | ||
port: 50000 | ||
- name: "third-route" | ||
hostname: "*" | ||
traffic: | ||
rateLimit: | ||
global: | ||
rules: | ||
- limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "test" | ||
destination: | ||
name: "third-route-dest" | ||
settings: | ||
- endpoints: | ||
- host: "1.2.3.4" | ||
port: 50000 |
96 changes: 96 additions & 0 deletions
96
internal/xds/translator/testdata/out/xds-ir/ratelimit-disable-headers.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,96 @@ | ||
- circuitBreakers: | ||
thresholds: | ||
- maxRetries: 1024 | ||
commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
serviceName: first-route-dest | ||
lbPolicy: LEAST_REQUEST | ||
name: first-route-dest | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS | ||
- circuitBreakers: | ||
thresholds: | ||
- maxRetries: 1024 | ||
commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
serviceName: second-route-dest | ||
lbPolicy: LEAST_REQUEST | ||
name: second-route-dest | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS | ||
- circuitBreakers: | ||
thresholds: | ||
- maxRetries: 1024 | ||
commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
serviceName: third-route-dest | ||
lbPolicy: LEAST_REQUEST | ||
name: third-route-dest | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS | ||
- circuitBreakers: | ||
thresholds: | ||
- maxRetries: 1024 | ||
commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
dnsRefreshRate: 30s | ||
lbPolicy: LEAST_REQUEST | ||
loadAssignment: | ||
clusterName: ratelimit_cluster | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: envoy-ratelimit.envoy-gateway-system.svc.cluster.local | ||
portValue: 8081 | ||
loadBalancingWeight: 1 | ||
loadBalancingWeight: 1 | ||
locality: | ||
region: ratelimit_cluster/backend/0 | ||
name: ratelimit_cluster | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
respectDnsTtl: true | ||
transportSocket: | ||
name: envoy.transport_sockets.tls | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext | ||
commonTlsContext: | ||
tlsCertificates: | ||
- certificateChain: | ||
filename: /certs/tls.crt | ||
privateKey: | ||
filename: /certs/tls.key | ||
validationContext: | ||
trustedCa: | ||
filename: /certs/ca.crt | ||
type: STRICT_DNS | ||
typedExtensionProtocolOptions: | ||
envoy.extensions.upstreams.http.v3.HttpProtocolOptions: | ||
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions | ||
explicitHttpConfig: | ||
http2ProtocolOptions: {} |
36 changes: 36 additions & 0 deletions
36
internal/xds/translator/testdata/out/xds-ir/ratelimit-disable-headers.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,36 @@ | ||
- clusterName: first-route-dest | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 1.2.3.4 | ||
portValue: 50000 | ||
loadBalancingWeight: 1 | ||
loadBalancingWeight: 1 | ||
locality: | ||
region: first-route-dest/backend/0 | ||
- clusterName: second-route-dest | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 1.2.3.4 | ||
portValue: 50000 | ||
loadBalancingWeight: 1 | ||
loadBalancingWeight: 1 | ||
locality: | ||
region: second-route-dest/backend/0 | ||
- clusterName: third-route-dest | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 1.2.3.4 | ||
portValue: 50000 | ||
loadBalancingWeight: 1 | ||
loadBalancingWeight: 1 | ||
locality: | ||
region: third-route-dest/backend/0 |
43 changes: 43 additions & 0 deletions
43
internal/xds/translator/testdata/out/xds-ir/ratelimit-disable-headers.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,43 @@ | ||
- 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 | ||
commonHttpProtocolOptions: | ||
headersWithUnderscoresAction: REJECT_REQUEST | ||
http2ProtocolOptions: | ||
initialConnectionWindowSize: 1048576 | ||
initialStreamWindowSize: 65536 | ||
maxConcurrentStreams: 100 | ||
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 | ||
suppressEnvoyHeaders: true | ||
mergeSlashes: true | ||
normalizePath: true | ||
pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT | ||
rds: | ||
configSource: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
routeConfigName: first-listener | ||
serverHeaderTransformation: PASS_THROUGH | ||
statPrefix: http | ||
useRemoteAddress: true | ||
drainType: MODIFY_ONLY | ||
name: first-listener | ||
perConnectionBufferLimitBytes: 32768 |
57 changes: 57 additions & 0 deletions
57
internal/xds/translator/testdata/out/xds-ir/ratelimit-disable-headers.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,57 @@ | ||
- ignorePortInHostMatching: true | ||
name: first-listener | ||
virtualHosts: | ||
- domains: | ||
- '*' | ||
name: first-listener/* | ||
routes: | ||
- match: | ||
path: foo/bar | ||
name: first-route | ||
route: | ||
cluster: first-route-dest | ||
rateLimits: | ||
- actions: | ||
- genericKey: | ||
descriptorKey: first-route | ||
descriptorValue: first-route | ||
- headerValueMatch: | ||
descriptorKey: rule-0-match-0 | ||
descriptorValue: rule-0-match-0 | ||
expectMatch: true | ||
headers: | ||
- name: x-user-id | ||
stringMatch: | ||
exact: one | ||
upgradeConfigs: | ||
- upgradeType: websocket | ||
- match: | ||
path: example | ||
name: second-route | ||
route: | ||
cluster: second-route-dest | ||
rateLimits: | ||
- actions: | ||
- genericKey: | ||
descriptorKey: second-route | ||
descriptorValue: second-route | ||
- requestHeaders: | ||
descriptorKey: rule-0-match-0 | ||
headerName: x-user-id | ||
upgradeConfigs: | ||
- upgradeType: websocket | ||
- match: | ||
path: test | ||
name: third-route | ||
route: | ||
cluster: third-route-dest | ||
rateLimits: | ||
- actions: | ||
- genericKey: | ||
descriptorKey: third-route | ||
descriptorValue: third-route | ||
- genericKey: | ||
descriptorKey: rule-0-match--1 | ||
descriptorValue: rule-0-match--1 | ||
upgradeConfigs: | ||
- upgradeType: websocket |