Created
August 17, 2022 15:14
-
-
Save qudongfang/75cf0230c0b2291006f72cd23d45f297 to your computer and use it in GitHub Desktop.
add headers via EnvoyFilter to all hosts and routes
This file contains hidden or 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
apiVersion: networking.istio.io/v1alpha3 | |
kind: EnvoyFilter | |
metadata: | |
name: add-x-cluster-client-ip-header | |
namespace: istio-system | |
spec: | |
configPatches: | |
- applyTo: ROUTE_CONFIGURATION | |
match: | |
context: SIDECAR_INBOUND | |
patch: | |
operation: MERGE | |
value: | |
request_headers_to_add: | |
- header: | |
key: 'x-cluster-client-ip' | |
value: '%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%' | |
append: false | |
# the following is used to debug | |
response_headers_to_add: | |
- header: | |
key: 'x-cluster-client-ip' | |
value: '%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%' | |
append: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment