-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workaround to #24 with envoy filter + adapter http endpoint.
- Loading branch information
Showing
4 changed files
with
87 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: EnvoyFilter | ||
metadata: | ||
name: orion-egress-filter | ||
namespace: default | ||
spec: | ||
workloadSelector: | ||
labels: | ||
app: httpbin | ||
configPatches: | ||
# The first patch adds the lua filter to the listener/http connection manager | ||
- applyTo: HTTP_FILTER | ||
match: | ||
context: SIDECAR_OUTBOUND | ||
listener: | ||
portNumber: 80 | ||
filterChain: | ||
filter: | ||
name: "envoy.http_connection_manager" | ||
subFilter: | ||
name: "envoy.router" | ||
patch: | ||
operation: INSERT_BEFORE | ||
value: # lua filter specification | ||
name: envoy.lua | ||
config: | ||
inlineCode: | | ||
function envoy_on_request(request_handle) | ||
local headers, body = request_handle:httpCall( | ||
"lua_cluster", { | ||
[":method"] = "GET", | ||
[":path"] = "/", | ||
[":authority"] = "lua_cluster"}, "", 5000) | ||
request_handle:headers():add("header", body) | ||
end | ||
# The second patch adds the cluster that is referenced by the lua code | ||
# cds match is omitted as a new cluster is being added | ||
- applyTo: CLUSTER | ||
# match: | ||
# context: SIDECAR_OUTBOUND | ||
patch: | ||
operation: ADD | ||
value: # cluster specification | ||
name: "lua_cluster" | ||
type: STRICT_DNS | ||
connect_timeout: 5.5s | ||
lb_policy: ROUND_ROBIN | ||
hosts: | ||
- socket_address: | ||
protocol: TCP | ||
address: "orionadapterservice.istio-system" | ||
port_value: 54321 |
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