Skip to content

Commit

Permalink
[api] Add Failover field to Backend
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
arkodg committed Aug 22, 2024
1 parent ada279e commit ba510e5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/v1alpha1/backend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ type BackendSpec struct {
//
// +optional
AppProtocols []AppProtocolType `json:"appProtocols,omitempty"`

// Failover This indicates whether the backend is designated as a failover.
// It is highly recommended to configure active or passive health checks to ensure that failover can be detected
// when the active backends become unhealthy and to automatically readjust once the primary backends are healthy again.
// The overprovisioning factor is set to 1.4, meaning the failover backends will only start receiving traffic when
// the health of the active backends falls below 72%.
//
// +optional
Failover *bool `json:"failover,omitempty"`
}

// BackendConditionType is a type of condition for a backend. This type should be
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ type BackendRef struct {
// when the active backends become unhealthy and to automatically readjust once the primary backends are healthy again.
// The overprovisioning factor is set to 1.4, meaning the failover backends will only start receiving traffic when
// the health of the active backends falls below 72%.
//
// +optional
Failover *bool `json:"failover,omitempty"`
}
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ spec:
x-kubernetes-validations:
- message: fqdn addresses cannot be mixed with other address types
rule: self.all(f, has(f.fqdn)) || !self.exists(f, has(f.fqdn))
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
It is highly recommended to configure active or passive health checks to ensure that failover can be detected
when the active backends become unhealthy and to automatically readjust once the primary backends are healthy again.
The overprovisioning factor is set to 1.4, meaning the failover backends will only start receiving traffic when
the health of the active backends falls below 72%.
type: boolean
type: object
status:
description: Status defines the current status of Backend.
Expand Down
1 change: 1 addition & 0 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `endpoints` | _[BackendEndpoint](#backendendpoint) array_ | true | Endpoints defines the endpoints to be used when connecting to the backend. |
| `appProtocols` | _[AppProtocolType](#appprotocoltype) array_ | false | AppProtocols defines the application protocols to be supported when connecting to the backend. |
| `failover` | _boolean_ | false | Failover This indicates whether the backend is designated as a failover.<br />It is highly recommended to configure active or passive health checks to ensure that failover can be detected<br />when the active backends become unhealthy and to automatically readjust once the primary backends are healthy again.<br />The overprovisioning factor is set to 1.4, meaning the failover backends will only start receiving traffic when<br />the health of the active backends falls below 72%. |


#### BackendStatus
Expand Down
1 change: 1 addition & 0 deletions site/content/zh/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `endpoints` | _[BackendEndpoint](#backendendpoint) array_ | true | Endpoints defines the endpoints to be used when connecting to the backend. |
| `appProtocols` | _[AppProtocolType](#appprotocoltype) array_ | false | AppProtocols defines the application protocols to be supported when connecting to the backend. |
| `failover` | _boolean_ | false | Failover This indicates whether the backend is designated as a failover.<br />It is highly recommended to configure active or passive health checks to ensure that failover can be detected<br />when the active backends become unhealthy and to automatically readjust once the primary backends are healthy again.<br />The overprovisioning factor is set to 1.4, meaning the failover backends will only start receiving traffic when<br />the health of the active backends falls below 72%. |


#### BackendStatus
Expand Down

0 comments on commit ba510e5

Please sign in to comment.