Skip to content

Commit

Permalink
Refactor IR creation for TLSRoute
Browse files Browse the repository at this point in the history
Takes forward PR envoyproxy#1798

Fixes: envoyproxy#1635

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg committed Nov 14, 2023
1 parent 6ba9ea4 commit 9d49777
Show file tree
Hide file tree
Showing 55 changed files with 679 additions and 881 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ xds:
region: grpcroute/default/backend/rule/0/backend/0
- endpointConfig:
'@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
clusterName: tlsroute/default/backend/rule/-1
clusterName: tcproute/default/backend/rule/-1
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -627,10 +627,10 @@ xds:
loadBalancingWeight: 1
loadBalancingWeight: 1
locality:
region: tlsroute/default/backend/rule/-1/backend/0
region: tcproute/default/backend/rule/-1/backend/0
- endpointConfig:
'@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
clusterName: tcproute/default/backend/rule/-1
clusterName: tlsroute/default/backend/rule/-1
endpoints:
- lbEndpoints:
- endpoint:
Expand All @@ -641,7 +641,7 @@ xds:
loadBalancingWeight: 1
loadBalancingWeight: 1
locality:
region: tcproute/default/backend/rule/-1/backend/0
region: tlsroute/default/backend/rule/-1/backend/0
- endpointConfig:
'@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
clusterName: udproute/default/backend/rule/-1
Expand Down Expand Up @@ -705,9 +705,9 @@ xds:
edsConfig:
ads: {}
resourceApiVersion: V3
serviceName: tlsroute/default/backend/rule/-1
serviceName: tcproute/default/backend/rule/-1
lbPolicy: LEAST_REQUEST
name: tlsroute/default/backend/rule/-1
name: tcproute/default/backend/rule/-1
outlierDetection: {}
perConnectionBufferLimitBytes: 32768
type: EDS
Expand All @@ -721,9 +721,9 @@ xds:
edsConfig:
ads: {}
resourceApiVersion: V3
serviceName: tcproute/default/backend/rule/-1
serviceName: tlsroute/default/backend/rule/-1
lbPolicy: LEAST_REQUEST
name: tcproute/default/backend/rule/-1
name: tlsroute/default/backend/rule/-1
outlierDetection: {}
perConnectionBufferLimitBytes: 32768
type: EDS
Expand Down Expand Up @@ -886,31 +886,8 @@ xds:
address:
socketAddress:
address: 0.0.0.0
portValue: 8443
filterChains:
- filterChainMatch:
serverNames:
- foo.com
filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
accessLog:
- name: envoy.access_loggers.file
typedConfig:
'@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
logFormat:
textFormatSource:
inlineString: |
{"start_time":"%START_TIME%","method":"%REQ(:METHOD)%","x-envoy-origin-path":"%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%","protocol":"%PROTOCOL%","response_code":"%RESPONSE_CODE%","response_flags":"%RESPONSE_FLAGS%","response_code_details":"%RESPONSE_CODE_DETAILS%","connection_termination_details":"%CONNECTION_TERMINATION_DETAILS%","upstream_transport_failure_reason":"%UPSTREAM_TRANSPORT_FAILURE_REASON%","bytes_received":"%BYTES_RECEIVED%","bytes_sent":"%BYTES_SENT%","duration":"%DURATION%","x-envoy-upstream-service-time":"%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%","x-forwarded-for":"%REQ(X-FORWARDED-FOR)%","user-agent":"%REQ(USER-AGENT)%","x-request-id":"%REQ(X-REQUEST-ID)%",":authority":"%REQ(:AUTHORITY)%","upstream_host":"%UPSTREAM_HOST%","upstream_cluster":"%UPSTREAM_CLUSTER%","upstream_local_address":"%UPSTREAM_LOCAL_ADDRESS%","downstream_local_address":"%DOWNSTREAM_LOCAL_ADDRESS%","downstream_remote_address":"%DOWNSTREAM_REMOTE_ADDRESS%","requested_server_name":"%REQUESTED_SERVER_NAME%","route_name":"%ROUTE_NAME%"}
path: /dev/stdout
cluster: tlsroute/default/backend/rule/-1
statPrefix: passthrough
listenerFilters:
- name: envoy.filters.listener.tls_inspector
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
name: default/eg/tls-passthrough/backend
portValue: 1234
name: default/eg/tcp
perConnectionBufferLimitBytes: 32768
- activeState:
listener:
Expand All @@ -931,24 +908,8 @@ xds:
address:
socketAddress:
address: 0.0.0.0
portValue: 1234
filterChains:
- filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
accessLog:
- name: envoy.access_loggers.file
typedConfig:
'@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
logFormat:
textFormatSource:
inlineString: |
{"start_time":"%START_TIME%","method":"%REQ(:METHOD)%","x-envoy-origin-path":"%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%","protocol":"%PROTOCOL%","response_code":"%RESPONSE_CODE%","response_flags":"%RESPONSE_FLAGS%","response_code_details":"%RESPONSE_CODE_DETAILS%","connection_termination_details":"%CONNECTION_TERMINATION_DETAILS%","upstream_transport_failure_reason":"%UPSTREAM_TRANSPORT_FAILURE_REASON%","bytes_received":"%BYTES_RECEIVED%","bytes_sent":"%BYTES_SENT%","duration":"%DURATION%","x-envoy-upstream-service-time":"%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%","x-forwarded-for":"%REQ(X-FORWARDED-FOR)%","user-agent":"%REQ(USER-AGENT)%","x-request-id":"%REQ(X-REQUEST-ID)%",":authority":"%REQ(:AUTHORITY)%","upstream_host":"%UPSTREAM_HOST%","upstream_cluster":"%UPSTREAM_CLUSTER%","upstream_local_address":"%UPSTREAM_LOCAL_ADDRESS%","downstream_local_address":"%DOWNSTREAM_LOCAL_ADDRESS%","downstream_remote_address":"%DOWNSTREAM_REMOTE_ADDRESS%","requested_server_name":"%REQUESTED_SERVER_NAME%","route_name":"%ROUTE_NAME%"}
path: /dev/stdout
cluster: tcproute/default/backend/rule/-1
statPrefix: tcp
name: default/eg/tcp/backend
portValue: 8443
name: default/eg/tls-passthrough
perConnectionBufferLimitBytes: 32768
- activeState:
listener:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
{
"endpointConfig": {
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment",
"clusterName": "tlsroute/default/backend/rule/-1",
"clusterName": "tcproute/default/backend/rule/-1",
"endpoints": [
{
"lbEndpoints": [
Expand All @@ -290,7 +290,7 @@
],
"loadBalancingWeight": 1,
"locality": {
"region": "tlsroute/default/backend/rule/-1/backend/0"
"region": "tcproute/default/backend/rule/-1/backend/0"
}
}
]
Expand All @@ -299,7 +299,7 @@
{
"endpointConfig": {
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment",
"clusterName": "tcproute/default/backend/rule/-1",
"clusterName": "tlsroute/default/backend/rule/-1",
"endpoints": [
{
"lbEndpoints": [
Expand All @@ -317,7 +317,7 @@
],
"loadBalancingWeight": 1,
"locality": {
"region": "tcproute/default/backend/rule/-1/backend/0"
"region": "tlsroute/default/backend/rule/-1/backend/0"
}
}
]
Expand Down Expand Up @@ -420,10 +420,10 @@
"ads": {},
"resourceApiVersion": "V3"
},
"serviceName": "tlsroute/default/backend/rule/-1"
"serviceName": "tcproute/default/backend/rule/-1"
},
"lbPolicy": "LEAST_REQUEST",
"name": "tlsroute/default/backend/rule/-1",
"name": "tcproute/default/backend/rule/-1",
"outlierDetection": {},
"perConnectionBufferLimitBytes": 32768,
"type": "EDS"
Expand All @@ -442,10 +442,10 @@
"ads": {},
"resourceApiVersion": "V3"
},
"serviceName": "tcproute/default/backend/rule/-1"
"serviceName": "tlsroute/default/backend/rule/-1"
},
"lbPolicy": "LEAST_REQUEST",
"name": "tcproute/default/backend/rule/-1",
"name": "tlsroute/default/backend/rule/-1",
"outlierDetection": {},
"perConnectionBufferLimitBytes": 32768,
"type": "EDS"
Expand Down Expand Up @@ -701,51 +701,10 @@
"address": {
"socketAddress": {
"address": "0.0.0.0",
"portValue": 8443
"portValue": 1234
}
},
"filterChains": [
{
"filterChainMatch": {
"serverNames": [
"foo.com"
]
},
"filters": [
{
"name": "envoy.filters.network.tcp_proxy",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
"accessLog": [
{
"name": "envoy.access_loggers.file",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"logFormat": {
"textFormatSource": {
"inlineString": "{\"start_time\":\"%START_TIME%\",\"method\":\"%REQ(:METHOD)%\",\"x-envoy-origin-path\":\"%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%\",\"protocol\":\"%PROTOCOL%\",\"response_code\":\"%RESPONSE_CODE%\",\"response_flags\":\"%RESPONSE_FLAGS%\",\"response_code_details\":\"%RESPONSE_CODE_DETAILS%\",\"connection_termination_details\":\"%CONNECTION_TERMINATION_DETAILS%\",\"upstream_transport_failure_reason\":\"%UPSTREAM_TRANSPORT_FAILURE_REASON%\",\"bytes_received\":\"%BYTES_RECEIVED%\",\"bytes_sent\":\"%BYTES_SENT%\",\"duration\":\"%DURATION%\",\"x-envoy-upstream-service-time\":\"%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%\",\"x-forwarded-for\":\"%REQ(X-FORWARDED-FOR)%\",\"user-agent\":\"%REQ(USER-AGENT)%\",\"x-request-id\":\"%REQ(X-REQUEST-ID)%\",\":authority\":\"%REQ(:AUTHORITY)%\",\"upstream_host\":\"%UPSTREAM_HOST%\",\"upstream_cluster\":\"%UPSTREAM_CLUSTER%\",\"upstream_local_address\":\"%UPSTREAM_LOCAL_ADDRESS%\",\"downstream_local_address\":\"%DOWNSTREAM_LOCAL_ADDRESS%\",\"downstream_remote_address\":\"%DOWNSTREAM_REMOTE_ADDRESS%\",\"requested_server_name\":\"%REQUESTED_SERVER_NAME%\",\"route_name\":\"%ROUTE_NAME%\"}\n"
}
},
"path": "/dev/stdout"
}
}
],
"cluster": "tlsroute/default/backend/rule/-1",
"statPrefix": "passthrough"
}
}
]
}
],
"listenerFilters": [
{
"name": "envoy.filters.listener.tls_inspector",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector"
}
}
],
"name": "default/eg/tls-passthrough/backend",
"name": "default/eg/tcp",
"perConnectionBufferLimitBytes": 32768
}
}
Expand Down Expand Up @@ -778,38 +737,10 @@
"address": {
"socketAddress": {
"address": "0.0.0.0",
"portValue": 1234
"portValue": 8443
}
},
"filterChains": [
{
"filters": [
{
"name": "envoy.filters.network.tcp_proxy",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
"accessLog": [
{
"name": "envoy.access_loggers.file",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"logFormat": {
"textFormatSource": {
"inlineString": "{\"start_time\":\"%START_TIME%\",\"method\":\"%REQ(:METHOD)%\",\"x-envoy-origin-path\":\"%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%\",\"protocol\":\"%PROTOCOL%\",\"response_code\":\"%RESPONSE_CODE%\",\"response_flags\":\"%RESPONSE_FLAGS%\",\"response_code_details\":\"%RESPONSE_CODE_DETAILS%\",\"connection_termination_details\":\"%CONNECTION_TERMINATION_DETAILS%\",\"upstream_transport_failure_reason\":\"%UPSTREAM_TRANSPORT_FAILURE_REASON%\",\"bytes_received\":\"%BYTES_RECEIVED%\",\"bytes_sent\":\"%BYTES_SENT%\",\"duration\":\"%DURATION%\",\"x-envoy-upstream-service-time\":\"%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%\",\"x-forwarded-for\":\"%REQ(X-FORWARDED-FOR)%\",\"user-agent\":\"%REQ(USER-AGENT)%\",\"x-request-id\":\"%REQ(X-REQUEST-ID)%\",\":authority\":\"%REQ(:AUTHORITY)%\",\"upstream_host\":\"%UPSTREAM_HOST%\",\"upstream_cluster\":\"%UPSTREAM_CLUSTER%\",\"upstream_local_address\":\"%UPSTREAM_LOCAL_ADDRESS%\",\"downstream_local_address\":\"%DOWNSTREAM_LOCAL_ADDRESS%\",\"downstream_remote_address\":\"%DOWNSTREAM_REMOTE_ADDRESS%\",\"requested_server_name\":\"%REQUESTED_SERVER_NAME%\",\"route_name\":\"%ROUTE_NAME%\"}\n"
}
},
"path": "/dev/stdout"
}
}
],
"cluster": "tcproute/default/backend/rule/-1",
"statPrefix": "tcp"
}
}
]
}
],
"name": "default/eg/tcp/backend",
"name": "default/eg/tls-passthrough",
"perConnectionBufferLimitBytes": 32768
}
}
Expand Down
Loading

0 comments on commit 9d49777

Please sign in to comment.