-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add support for configuring gateway to direct_response on HTTP routes. #2714
Comments
@rsaelim can you share your use case ? |
My use case: I want to configure the gateway to respond to requests matching on certain http route rule with no upstream backend, and just return a 200.
|
raised kubernetes-sigs/gateway-api#2826 in upstream |
You can sorta do this with a fault injection policy: apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: fault-injection-200
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: eg
rules:
- backendRefs:
- kind: Service
name: backend
port: 3000
matches:
- path:
type: PathPrefix
value: /fault-injection-200
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
name: fault-injection-200
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: fault-injection-200
faultInjection:
abort:
httpStatus: 200 The result:
If all you're using the 200 fault responses for is a synthetic 'ok' response, it is also possible to override the apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyPatchPolicy
metadata:
name: fault-injection-200
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: eg
type: JSONPatch
jsonPatches:
- type: type.googleapis.com/envoy.config.listener.v3.Listener
name: default/eg/http
operation:
op: add
path: /default_filter_chain/filters/0/typed_config/local_reply_config
value:
mappers:
- body:
inline_string: OK
filter:
status_code_filter:
comparison:
op: EQ
value:
default_value: "200"
runtime_key: key_b |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
Bump |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
we can reuse the same structure of |
Relates to envoyproxy#2714 Signed-off-by: Arko Dasgupta <[email protected]>
Relates to envoyproxy#2714 Signed-off-by: Arko Dasgupta <[email protected]>
* api: direct response Relates to #2714 Signed-off-by: Arko Dasgupta <[email protected]>
Relates to envoyproxy#2714 Signed-off-by: Arko Dasgupta <[email protected]>
* feat: direct response Relates to #2714 Signed-off-by: Arko Dasgupta <[email protected]> * provider logic Signed-off-by: Arko Dasgupta <[email protected]> * default status code is 200 Signed-off-by: Arko Dasgupta <[email protected]> --------- Signed-off-by: Arko Dasgupta <[email protected]>
* feat: direct response Relates to envoyproxy#2714 Signed-off-by: Arko Dasgupta <[email protected]> * provider logic Signed-off-by: Arko Dasgupta <[email protected]> * default status code is 200 Signed-off-by: Arko Dasgupta <[email protected]> --------- Signed-off-by: Arko Dasgupta <[email protected]>
* feat: direct response Relates to envoyproxy#2714 Signed-off-by: Arko Dasgupta <[email protected]> * provider logic Signed-off-by: Arko Dasgupta <[email protected]> * default status code is 200 Signed-off-by: Arko Dasgupta <[email protected]> --------- Signed-off-by: Arko Dasgupta <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]>
* feat: direct response Relates to envoyproxy#2714 Signed-off-by: Arko Dasgupta <[email protected]> * provider logic Signed-off-by: Arko Dasgupta <[email protected]> * default status code is 200 Signed-off-by: Arko Dasgupta <[email protected]> --------- Signed-off-by: Arko Dasgupta <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]>
closing this one since we have a separate issue for docs and e2e #4511 |
Description:
It would be nice to support use case where users can configure the gateway to direct respond 200 on a HTTP route without upstream backend.
The text was updated successfully, but these errors were encountered: