Skip to content

Commit 3b0c9d6

Browse files
authored
Merge pull request #1907 from kei-gnu/istio-split-external-local-origin-errors
feat: add support istio's splitExternalLocalOriginErrors and consecutiveLocalOriginFailures
2 parents f5cccbf + cd964bb commit 3b0c9d6

5 files changed

Lines changed: 50 additions & 0 deletions

File tree

artifacts/flagger/crd.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,12 @@ spec:
859859
ejected from the connection pool.
860860
format: int32
861861
type: integer
862+
consecutiveLocalOriginFailures:
863+
description: Number of consecutive locally originated
864+
failures before ejection. Takes effect only when
865+
splitExternalLocalOriginErrors is set to true.
866+
format: int32
867+
type: integer
862868
interval:
863869
description: Time interval between ejection sweep analysis.
864870
type: string
@@ -868,6 +874,10 @@ spec:
868874
minHealthPercent:
869875
format: int32
870876
type: integer
877+
splitExternalLocalOriginErrors:
878+
description: Determines whether to distinguish local
879+
origin failures from external errors.
880+
type: boolean
871881
tls:
872882
description: Istio TLS related settings for connections to the upstream service
873883
type: object

charts/flagger/crds/crd.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,12 @@ spec:
859859
ejected from the connection pool.
860860
format: int32
861861
type: integer
862+
consecutiveLocalOriginFailures:
863+
description: Number of consecutive locally originated
864+
failures before ejection. Takes effect only when
865+
splitExternalLocalOriginErrors is set to true.
866+
format: int32
867+
type: integer
862868
interval:
863869
description: Time interval between ejection sweep analysis.
864870
type: string
@@ -868,6 +874,10 @@ spec:
868874
minHealthPercent:
869875
format: int32
870876
type: integer
877+
splitExternalLocalOriginErrors:
878+
description: Determines whether to distinguish local
879+
origin failures from external errors.
880+
type: boolean
871881
tls:
872882
description: Istio TLS related settings for connections to the upstream service
873883
type: object

kustomize/base/flagger/crd.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,12 @@ spec:
859859
ejected from the connection pool.
860860
format: int32
861861
type: integer
862+
consecutiveLocalOriginFailures:
863+
description: Number of consecutive locally originated
864+
failures before ejection. Takes effect only when
865+
splitExternalLocalOriginErrors is set to true.
866+
format: int32
867+
type: integer
862868
interval:
863869
description: Time interval between ejection sweep analysis.
864870
type: string
@@ -868,6 +874,10 @@ spec:
868874
minHealthPercent:
869875
format: int32
870876
type: integer
877+
splitExternalLocalOriginErrors:
878+
description: Determines whether to distinguish local
879+
origin failures from external errors.
880+
type: boolean
871881
tls:
872882
description: Istio TLS related settings for connections to the upstream service
873883
type: object

pkg/apis/istio/v1beta1/destination_rule.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,21 @@ type OutlierDetection struct {
620620
// no effect.
621621
Consecutive5xxErrors *uint32 `json:"consecutive5xxErrors,omitempty"`
622622

623+
// Determines whether to distinguish local origin failures from external errors. If set to true
624+
// `consecutiveLocalOriginFailures` is taken into account for outlier detection calculations.
625+
// This should be used when you want to derive the outlier detection status based on the errors
626+
// seen locally such as failure to connect, timeout while connecting etc. rather than the status code
627+
// returned by upstream service. This is especially useful when the upstream service explicitly returns
628+
// a 5xx for some requests and you want to ignore those responses from upstream service while determining
629+
// the outlier detection status of a host.
630+
// Defaults to false.
631+
SplitExternalLocalOriginErrors bool `json:"splitExternalLocalOriginErrors,omitempty"`
632+
633+
// The number of consecutive locally originated failures before ejection
634+
// occurs. Defaults to 5. Parameter takes effect only when `splitExternalLocalOriginErrors`
635+
// is set to true.
636+
ConsecutiveLocalOriginFailures *uint32 `json:"consecutiveLocalOriginFailures,omitempty"`
637+
623638
// Time interval between ejection sweep analysis. format:
624639
// 1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s.
625640
Interval string `json:"interval,omitempty"`

pkg/apis/istio/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)