1
0
Fork 0

Add passive health checks

This commit is contained in:
Nelson Isioma 2025-08-21 10:40:06 +01:00 committed by GitHub
parent c20802b07e
commit fc0fac8543
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 696 additions and 6 deletions

View file

@ -144,6 +144,8 @@ type LoadBalancerSpec struct {
NodePortLB bool `json:"nodePortLB,omitempty"`
// Healthcheck defines health checks for ExternalName services.
HealthCheck *ServerHealthCheck `json:"healthCheck,omitempty"`
// PassiveHealthCheck defines passive health checks for ExternalName services.
PassiveHealthCheck *PassiveServerHealthCheck `json:"passiveHealthCheck,omitempty"`
}
type ResponseForwarding struct {
@ -189,6 +191,13 @@ type ServerHealthCheck struct {
Headers map[string]string `json:"headers,omitempty"`
}
type PassiveServerHealthCheck struct {
// FailureWindow defines the time window during which the failed attempts must occur for the server to be marked as unhealthy. It also defines for how long the server will be considered unhealthy.
FailureWindow *intstr.IntOrString `json:"failureWindow,omitempty"`
// MaxFailedAttempts is the number of consecutive failed attempts allowed within the failure window before marking the server as unhealthy.
MaxFailedAttempts *int `json:"maxFailedAttempts,omitempty"`
}
// Service defines an upstream HTTP service to proxy traffic to.
type Service struct {
LoadBalancerSpec `json:",inline"`

View file

@ -657,6 +657,11 @@ func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) {
*out = new(ServerHealthCheck)
(*in).DeepCopyInto(*out)
}
if in.PassiveHealthCheck != nil {
in, out := &in.PassiveHealthCheck, &out.PassiveHealthCheck
*out = new(PassiveServerHealthCheck)
(*in).DeepCopyInto(*out)
}
return
}
@ -1047,6 +1052,32 @@ func (in *ObjectReference) DeepCopy() *ObjectReference {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PassiveServerHealthCheck) DeepCopyInto(out *PassiveServerHealthCheck) {
*out = *in
if in.FailureWindow != nil {
in, out := &in.FailureWindow, &out.FailureWindow
*out = new(intstr.IntOrString)
**out = **in
}
if in.MaxFailedAttempts != nil {
in, out := &in.MaxFailedAttempts, &out.MaxFailedAttempts
*out = new(int)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PassiveServerHealthCheck.
func (in *PassiveServerHealthCheck) DeepCopy() *PassiveServerHealthCheck {
if in == nil {
return nil
}
out := new(PassiveServerHealthCheck)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RateLimit) DeepCopyInto(out *RateLimit) {
*out = *in