-
Notifications
You must be signed in to change notification settings - Fork 334
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
feat:support slow start mode #2219
Conversation
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2219 +/- ##
==========================================
+ Coverage 64.49% 64.50% +0.01%
==========================================
Files 111 111
Lines 15482 15542 +60
==========================================
+ Hits 9985 10026 +41
- Misses 4881 4900 +19
Partials 616 616 ☔ View full report in Codecov by Sentry. |
can you share the use case for this? add an e2e test for this if possible? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally LGTM, just some nits and please fix ci
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
|
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
/retest |
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
@@ -91,3 +110,33 @@ backendTrafficPolicies: | |||
type: ConsistentHash | |||
consistentHash: | |||
type: SourceIP | |||
- apiVersion: gateway.envoyproxy.io/v1alpha1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of creating a new route, can we just add this slowStart
config to the existing config ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing route has been used to test ConsistentHash
, so a new route needs to be added
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
/retest |
// +k8s:deepcopy-gen=true | ||
type SlowStart struct { | ||
// Window defines the duration of the warm up period for newly added host. | ||
Window *metav1.Duration `json:"window" yaml:"window"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Window be defined as a pointer here? It's required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested this, to make it easier for adding if
checks within xds code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean here? Can the second if be removed since window
is a mandatory field?
if args.loadBalancer.RoundRobin.SlowStart != nil {
if args.loadBalancer.RoundRobin.SlowStart.Window != nil {
cluster.LbConfig = &clusterv3.Cluster_RoundRobinLbConfig_{
RoundRobinLbConfig: &clusterv3.Cluster_RoundRobinLbConfig{
SlowStartConfig: &clusterv3.Cluster_SlowStartConfig{
SlowStartWindow: durationpb.New(args.loadBalancer.RoundRobin.SlowStart.Window.Duration),
},
},
}
}
}
// Currently only supports linear growth of traffic. For additional details, | ||
// see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig | ||
// +kubebuilder:validation:Required | ||
Window *metav1.Duration `json:"window"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above. Should Window
be defined as a pointer here? It's required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just some small nits.
case egv1a1.RandomLoadBalancerType: | ||
lb = &ir.LoadBalancer{ | ||
Random: &ir.Random{}, | ||
} | ||
case egv1a1.RoundRobinLoadBalancerType: | ||
lb = &ir.LoadBalancer{ | ||
RoundRobin: &ir.RoundRobin{}, | ||
RoundRobin: &ir.RoundRobin{ | ||
SlowStart: &ir.SlowStart{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this slow start field still exists on line 455, can you rm this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, my bad, I totally missed it many times.
Signed-off-by: zhaonan <zhaonan06@corp.netease.com>
What type of PR is this?
Support slow start model
What this PR does / why we need it:
Which issue(s) this PR fixes:
Releated:
#1902
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster-slowstartconfig