-
Notifications
You must be signed in to change notification settings - Fork 716
EnvoyPatchPolicy with targetRef #8623
Copy link
Copy link
Open
Labels
area/apiAPI-related issuesAPI-related issues
Description
-
should we allow to use targetRefs like EnvoyExtensionPolicy?
-
TargetRef to Gateway in MergeGateways mode not working
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyPatchPolicy
metadata:
name: patch-gateway-class
namespace: default
spec:
targetRef:
group: gateway.networking.k8s.io
kind: GatewayClass
name: eg-merge-demo
type: JSONPatch
jsonPatches:
- name: "default/gateway-v1/http-v1"
type: type.googleapis.com/envoy.config.listener.v3.Listener
operation:
op: add
path: /default_filter_chain/filters/0/typed_config/http_filters/0
value:
name: "envoy.lua"
typedConfig:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
typeUrl: type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
value:
inline_code: |
function envoy_on_request(request_handle)
-- Make an HTTP call to an upstream host with the following headers, body, and timeout.
val = request_handle:headers():get("x-envoy-peer-metadata-id")
request_handle:logWarn("get result: " .. val)
end
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyPatchPolicy
metadata:
name: patch-gateway
namespace: default
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: gateway-v2
type: JSONPatch
jsonPatches:
- name: "default/gateway-v2/http-v2"
type: type.googleapis.com/envoy.config.listener.v3.Listener
operation:
op: add
path: /default_filter_chain/filters/0/typed_config/http_filters/0
value:
name: "envoy.lua"
typedConfig:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
typeUrl: type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
value:
inline_code: |
function envoy_on_request(request_handle)
-- Make an HTTP call to an upstream host with the following headers, body, and timeout.
val = request_handle:headers():get("x-envoy-peer-metadata-id")
request_handle:logWarn("get result: " .. val)
endNAME ACCEPTED PROGRAMMED AGE
patch-gateway 7m5s
patch-gateway-class True True 7m5spatch-gateway was ignored without any information, here are some thinkings:
- Should EG allow to patch gateway in merge gateways mode?
- Should EG allow to patch GatewayClass(attached to all the gateways within the GatewayClass) in default mode?
More thinking about this:
The EnvoyExtensionPolicy "lua-extension-policy" is invalid: spec: Invalid value: "object": this policy can only have a targetRefs[*].kind of Gateway/HTTPRoute/GRPCRoute/TCPRoute/UDPRoute/TLSRoute
Should we allow EnvoyExtensionPolicy target to a GatewayClass?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/apiAPI-related issuesAPI-related issues