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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/v1alpha1/backend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ type BackendSpec struct {
//
// +optional
AppProtocols []AppProtocolType `json:"appProtocols,omitempty"`

// Failover 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
// +notImplementedHide
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

}

// BackendConditionType is a type of condition for a backend. This type should be
Expand Down
3 changes: 2 additions & 1 deletion api/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,13 @@ type BackendRef struct {
// BackendObjectReference references a Kubernetes object that represents the backend.
// Only Service kind is supported for now.
gwapiv1.BackendObjectReference `json:",inline"`
// Failover This indicates whether the backend is designated as a failover.
// Failover indicates whether the backend is designated as a failover.
// Multiple failover backends can be configured.
// 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"`
}
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 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
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ spec:
properties:
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
Failover indicates whether the backend is designated as a failover.
Multiple failover backends can be configured.
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10400,7 +10400,7 @@ spec:
properties:
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
Failover indicates whether the backend is designated as a failover.
Multiple failover backends can be configured.
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.
Expand Down Expand Up @@ -11299,7 +11299,7 @@ spec:
properties:
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
Failover indicates whether the backend is designated as a failover.
Multiple failover backends can be configured.
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.
Expand Down Expand Up @@ -12276,7 +12276,7 @@ spec:
properties:
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
Failover indicates whether the backend is designated as a failover.
Multiple failover backends can be configured.
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.
Expand Down Expand Up @@ -13188,7 +13188,7 @@ spec:
properties:
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
Failover indicates whether the backend is designated as a failover.
Multiple failover backends can be configured.
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ spec:
properties:
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
Failover indicates whether the backend is designated as a failover.
Multiple failover backends can be configured.
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.
Expand Down Expand Up @@ -1159,7 +1159,7 @@ spec:
properties:
failover:
description: |-
Failover This indicates whether the backend is designated as a failover.
Failover indicates whether the backend is designated as a failover.
Multiple failover backends can be configured.
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.
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ _Appears in:_
| `name` | _[ObjectName](#objectname)_ | true | Name is the name of the referent. |
| `namespace` | _[Namespace](#namespace)_ | false | Namespace is the namespace of the backend. When unspecified, the local<br />namespace is inferred.<br /><br />Note that when a namespace different than the local namespace is specified,<br />a ReferenceGrant object is required in the referent namespace to allow that<br />namespace's owner to accept the reference. See the ReferenceGrant<br />documentation for details.<br /><br />Support: Core |
| `port` | _[PortNumber](#portnumber)_ | false | Port specifies the destination port number to use for this resource.<br />Port is required when the referent is a Kubernetes Service. In this<br />case, the port number is the service port number, not the target port.<br />For other resources, destination port might be derived from the referent<br />resource or this field. |
| `failover` | _boolean_ | false | Failover This indicates whether the backend is designated as a failover.<br />Multiple failover backends can be configured.<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%. |
| `failover` | _boolean_ | false | Failover indicates whether the backend is designated as a failover.<br />Multiple failover backends can be configured.<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%. |


#### BackendSpec
Expand Down
2 changes: 1 addition & 1 deletion site/content/zh/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ _Appears in:_
| `name` | _[ObjectName](#objectname)_ | true | Name is the name of the referent. |
| `namespace` | _[Namespace](#namespace)_ | false | Namespace is the namespace of the backend. When unspecified, the local<br />namespace is inferred.<br /><br />Note that when a namespace different than the local namespace is specified,<br />a ReferenceGrant object is required in the referent namespace to allow that<br />namespace's owner to accept the reference. See the ReferenceGrant<br />documentation for details.<br /><br />Support: Core |
| `port` | _[PortNumber](#portnumber)_ | false | Port specifies the destination port number to use for this resource.<br />Port is required when the referent is a Kubernetes Service. In this<br />case, the port number is the service port number, not the target port.<br />For other resources, destination port might be derived from the referent<br />resource or this field. |
| `failover` | _boolean_ | false | Failover This indicates whether the backend is designated as a failover.<br />Multiple failover backends can be configured.<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%. |
| `failover` | _boolean_ | false | Failover indicates whether the backend is designated as a failover.<br />Multiple failover backends can be configured.<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%. |


#### BackendSpec
Expand Down