-
Notifications
You must be signed in to change notification settings - Fork 741
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
feat(gateway-api): Add custom backendRef and filters support for HTTPRoute #1742
base: main
Are you sure you want to change the base?
Conversation
b711e6d
to
df378db
Compare
f89feb6
to
5931ff6
Compare
3cd52c0
to
4f3511b
Compare
Dear @stefanprodan I hope this message finds you well. I am reaching out to request your review on an enhancement I am working on for the Flagger gateway API. My goal is to support the integration of Envoy Gateway with KEDA HTTPScaledObjects through this enhancement. I would greatly appreciate your feedback and insights on this matter. Thank you for your time and consideration. Best regards, |
thank you for this PR @kahirokunn! have you tested how this change behaves when performing a canary rollout with session affinity enabled? that code also makes use of backend specific filters, so its important to verify that any userland configuration will not break that feature. |
Thank you so much for your feedback regarding session affinity! I will do my best to verify that these changes won’t break any existing session affinity behavior. However, to avoid any misunderstanding or missing test scenarios, would you mind sharing a bit more detail on the specific cases or concerns you have in mind about backend-specific filters and userland configurations? Your insights would be really helpful, and I appreciate your cooperation. |
i'd recommend following the tutorial in the docs and seeing if the behaviour is as expected (in terms of request-response and how the HTTPRoute definition looks like) |
aca6a96
to
9f47b21
Compare
…Route Signed-off-by: kahirokunn <[email protected]>
9f47b21
to
66df957
Compare
Hello, Following your recommendation, I walked through the tutorial in the docs. I executed the tests as described using the Canary resource defined below: apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: podinfo
namespace: test
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: podinfo
progressDeadlineSeconds: 60
autoscalerRef:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
name: podinfo
service:
port: 9898
targetPort: 9898
hosts:
- www.example.com
gatewayRefs:
- name: gateway
namespace: istio-ingress
primaryBackend:
backendRef:
name: hoge
namespace: kube-system
port: 10250
canaryBackend:
filters:
- type: URLRewrite
urlRewrite:
hostname: www.example.com
analysis:
interval: 1m
threshold: 5
maxWeight: 50
stepWeight: 10
metrics:
- name: error-rate
templateRef:
name: error-rate
namespace: flagger-system
thresholdRange:
max: 1
interval: 1m
- name: latency
templateRef:
name: latency
namespace: flagger-system
thresholdRange:
max: 0.5
interval: 30s
webhooks:
- name: smoke-test
type: pre-rollout
url: http://flagger-loadtester.test/
timeout: 15s
metadata:
type: bash
cmd: "curl -sd 'anon' http://podinfo-canary.test:9898/token | grep token"
- name: load-test
url: http://flagger-loadtester.test/
timeout: 5s
metadata:
cmd: "hey -z 2m -q 10 -c 2 -host www.example.com http://gateway-istio.istio-ingress/" Based on this request, I confirmed that the following resources were created as expected:
Moreover, tests have been written to validate this behavior. With these outcomes, the resources appear to adhere to the expected request-response behavior and the corresponding HTTPRoute definition matches. |
Description
This PR adds support for custom backend references in Flagger's primary and canary services. This enhancement allows users to specify different routing configurations and intermediate services for primary and canary traffic, enabling more complex deployment patterns and better integration with existing infrastructure.
Key Changes
backendRef
andfilters
tospec.service.canary
andspec.service.primary
Use Cases
This feature enables several important scenarios:
Example Configuration
Breaking Changes
None. This is a backward-compatible change that maintains existing behavior when custom backend references are not specified.
Additional Context
This change also allows for cases where different backends are referenced for canary and primary, as shown in the attached image.
For details, please refer to the following PR.
#1714
Issue
#1741
TODO