Skip to content
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

[api] Add Failover field to Backend #4099

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Aug 22, 2024

Adds a failover field to Backend API so we can support Active/Passive Failove backends within xRoutes similar to #4033

Relates to #3055

Adds a `failover` field to Backend API so we can support Active/Passive
Failove backends within xRoutes similar to envoyproxy#4033

Relates to envoyproxy#3055

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@arkodg arkodg requested a review from a team as a code owner August 22, 2024 23:31
@arkodg
Copy link
Contributor Author

arkodg commented Aug 22, 2024

cc @alexwo

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.93%. Comparing base (ada279e) to head (35eb8e3).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4099      +/-   ##
==========================================
- Coverage   67.94%   67.93%   -0.02%     
==========================================
  Files         187      187              
  Lines       23029    23029              
==========================================
- Hits        15647    15644       -3     
- Misses       6266     6268       +2     
- Partials     1116     1117       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// the health of the active backends falls below 72%.
//
// +optional
Failover *bool `json:"failover,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not imeplemented hide? Or do you plan on implementing this in the near future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plan on adding it in a follow up PR but I'll add the tag

guydc
guydc previously approved these changes Aug 23, 2024
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@arkodg arkodg merged commit 3119549 into envoyproxy:main Aug 27, 2024
27 checks passed
@arkodg arkodg deleted the failover-backend branch August 27, 2024 14:52
@ferdinandosimonetti
Copy link

Hello, I'm using the Envoy Gateway version 1.1.2 and (according to kubectl explain httproute.spec.rules.backendRefs) the new field is not available.
Any hints on whether the discussed failover field will be implemented, and in which official release?
Thanks in advance
Best regards

@zirain
Copy link
Contributor

zirain commented Oct 18, 2024

Hello, I'm using the Envoy Gateway version 1.1.2 and (according to kubectl explain httproute.spec.rules.backendRefs) the new field is not available. Any hints on whether the discussed failover field will be implemented, and in which official release? Thanks in advance Best regards

should be v1.2

@ferdinandosimonetti
Copy link

Hello, I'm using the Envoy Gateway version 1.1.2 and (according to kubectl explain httproute.spec.rules.backendRefs) the new field is not available. Any hints on whether the discussed failover field will be implemented, and in which official release? Thanks in advance Best regards

should be v1.2

If someone wants to test this feature before the 1.2 release, it is possible to do that by installing v0.0.0-latest Helm Chart? Thanks again!

@zirain
Copy link
Contributor

zirain commented Oct 18, 2024

yes, normally new feature won't be backported.

@ferdinandosimonetti
Copy link

Sorry. I didn't understand.
I have currently v0.0.0-latest Helm Chart version installed, that took along its CRDs.

But this HTTPRoute

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: backend
  namespace: default
spec:
  parentRefs:
    - name: test-fsmn-xyz
      sectionName: https
  hostnames:
    - "test0.fsmn.xyz"
  rules:
    - backendRefs:
        - group: ""
          kind: Service
          name: backend
          port: 3000
        - group: ""
          kind: Service
          name: backend2
          port: 3000
          failover: True
      matches:
        - path:
            type: PathPrefix
            value: /

won't apply

strict decoding error: unknown field "spec.rules[0].backendRefs[1].failover"

Did I misunderstand the intended placement of the Failover: attribute?

@arkodg
Copy link
Contributor Author

arkodg commented Oct 18, 2024

Sorry. I didn't understand. I have currently v0.0.0-latest Helm Chart version installed, that took along its CRDs.

But this HTTPRoute

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: backend
  namespace: default
spec:
  parentRefs:
    - name: test-fsmn-xyz
      sectionName: https
  hostnames:
    - "test0.fsmn.xyz"
  rules:
    - backendRefs:
        - group: ""
          kind: Service
          name: backend
          port: 3000
        - group: ""
          kind: Service
          name: backend2
          port: 3000
          failover: True
      matches:
        - path:
            type: PathPrefix
            value: /

won't apply

strict decoding error: unknown field "spec.rules[0].backendRefs[1].failover"

Did I misunderstand the intended placement of the Failover: attribute?

hey the field was renamed to fallback and its part of the Backend API, not backendRef
https://gateway.envoyproxy.io/latest/api/extension_types/#backendspec
this is an unreleased feature, but you can try it out with v0.0.0-latest .
You'll need to setup health checks in the BackendTrafficPolicy to make sure this works. The docs highlighting this should be out soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants