Skip to content

[api] Add Failover field to Backend - #4099

Merged
arkodg merged 3 commits into
envoyproxy:mainfrom
arkodg:failover-backend
Aug 27, 2024
Merged

arkodg merged 3 commits into
envoyproxy:mainfrom
arkodg:failover-backend

Conversation

@arkodg

@arkodg arkodg commented Aug 22, 2024

Copy link
Copy Markdown
Contributor

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 <[email protected]>
@arkodg
arkodg requested a review from a team as a code owner August 22, 2024 23:31
@arkodg

arkodg commented Aug 22, 2024

Copy link
Copy Markdown
Contributor Author

cc @alexwo

Signed-off-by: Arko Dasgupta <[email protected]>
@codecov

codecov Bot commented Aug 22, 2024 •

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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 <[email protected]>
@arkodg
arkodg requested review from a team and guydc August 23, 2024 17:22
@arkodg
arkodg merged commit 3119549 into envoyproxy:main Aug 27, 2024
@arkodg
arkodg deleted the failover-backend branch August 27, 2024 14:52
@ferdinandosimonetti

Copy link
Copy Markdown

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

zirain commented Oct 18, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown

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

zirain commented Oct 18, 2024

Copy link
Copy Markdown
Member

yes, normally new feature won't be backported.

@ferdinandosimonetti

Copy link
Copy Markdown

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

arkodg commented Oct 18, 2024

Copy link
Copy Markdown
Contributor Author

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