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

[MESH-3036] - Set consecutive5xxErrors to 0 #288

Merged
merged 2 commits into from
May 5, 2023
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
5 changes: 4 additions & 1 deletion admiral/pkg/clusters/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
const (
DefaultBaseEjectionTime int64 = 300
DefaultConsecutiveGatewayErrors uint32 = 50
DefaultConsecutive5xxErrors uint32 = 0
DefaultInterval int64 = 60
DefaultHTTP2MaxRequests int32 = 1000
DefaultMaxRequestsPerConnection int32 = 100
Expand Down Expand Up @@ -142,7 +143,9 @@ func getOutlierDetection(se *networkingv1alpha3.ServiceEntry, locality string, g
outlierDetection := &networkingv1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: DefaultBaseEjectionTime},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: DefaultConsecutiveGatewayErrors},
Interval: &duration.Duration{Seconds: DefaultInterval},
// The default Consecutive5XXErrors is set to 5 in envoy, setting to 0 disables 5XX error outlier detection so that ConsecutiveGatewayErrors rule can get evaluated
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: DefaultConsecutive5xxErrors},
Interval: &duration.Duration{Seconds: DefaultInterval},
}

if gtpTrafficPolicy != nil && gtpTrafficPolicy.OutlierDetection != nil {
Expand Down
7 changes: 7 additions & 0 deletions admiral/pkg/clusters/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func TestGetDestinationRule(t *testing.T) {
outlierDetection := &v1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: 300},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: 50},
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: 0},
Interval: &duration.Duration{Seconds: 60},
MaxEjectionPercent: 100,
}
Expand Down Expand Up @@ -329,13 +330,15 @@ func TestGetOutlierDetection(t *testing.T) {
outlierDetection := &v1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: DefaultBaseEjectionTime},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: DefaultConsecutiveGatewayErrors},
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: DefaultConsecutive5xxErrors},
Interval: &duration.Duration{Seconds: DefaultInterval},
MaxEjectionPercent: 100,
}

outlierDetectionOneHostRemote := &v1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: DefaultBaseEjectionTime},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: DefaultConsecutiveGatewayErrors},
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: DefaultConsecutive5xxErrors},
Interval: &duration.Duration{Seconds: DefaultInterval},
MaxEjectionPercent: 34,
}
Expand Down Expand Up @@ -437,6 +440,7 @@ func TestGetOutlierDetection(t *testing.T) {
outlierDetection: &v1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: DefaultBaseEjectionTime},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: 10},
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: 0},
Interval: &duration.Duration{Seconds: 60},
MaxEjectionPercent: 100,
},
Expand All @@ -461,6 +465,7 @@ func TestGetOutlierDetection(t *testing.T) {
outlierDetection: &v1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: 600},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: DefaultConsecutiveGatewayErrors},
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: DefaultConsecutive5xxErrors},
Interval: &duration.Duration{Seconds: 60},
MaxEjectionPercent: 100,
},
Expand All @@ -485,6 +490,7 @@ func TestGetOutlierDetection(t *testing.T) {
outlierDetection: &v1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: 600},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: 50},
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: 0},
Interval: &duration.Duration{Seconds: DefaultInterval},
MaxEjectionPercent: 100,
},
Expand All @@ -510,6 +516,7 @@ func TestGetOutlierDetection(t *testing.T) {
outlierDetection: &v1alpha3.OutlierDetection{
BaseEjectionTime: &duration.Duration{Seconds: 600},
ConsecutiveGatewayErrors: &wrappers.UInt32Value{Value: 10},
Consecutive_5XxErrors: &wrappers.UInt32Value{Value: 0},
Interval: &duration.Duration{Seconds: 60},
MaxEjectionPercent: 100,
},
Expand Down