Skip to content

Commit 2397ade

Browse files
frgaudethowardjohn
andauthored
feat(DestinationRules): Adding aggression and min_weight_percent to DestinationRules API (#3216)
* feat(): Adding aggression and min_weight_percent to DestinationRules API Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Wrapping slowStart parameters Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Adding aggression and min_weight_percent to DestinationRules API Signed-off-by: Frédéric Gaudet <[email protected]> * Update networking/v1alpha3/destination_rule.proto Co-authored-by: John Howard <[email protected]> * feat(): Regenerating protos Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Update documentation Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Adding validation in LoadBalancerSettings Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Adding tests and comments Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Fixing tests Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Make Duration field required Signed-off-by: Frédéric Gaudet <[email protected]> * feat(): Gen files Signed-off-by: Frédéric Gaudet <[email protected]> --------- Signed-off-by: Frédéric Gaudet <[email protected]> Co-authored-by: John Howard <[email protected]>
1 parent bfb6855 commit 2397ade

11 files changed

+1009
-385
lines changed

kubernetes/customresourcedefinitions.gen.yaml

+318-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1/destination_rule_alias.gen.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1alpha3/destination_rule.pb.go

+484-366
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1alpha3/destination_rule.pb.html

+64-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1alpha3/destination_rule.proto

+22-2
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ message Subset {
377377
// ```
378378
//
379379
message LoadBalancerSettings {
380+
// +kubebuilder:validation:XValidation:message="only one of warmupDurationSecs or warmup can be set",rule="(has(self.warmupDurationSecs)?1:0)+(has(self.warmup)?1:0)<=1"
380381
// Standard load balancing algorithms that require no tuning.
381382
enum SimpleLB {
382383
// No load balancing algorithm has been specified by the user. Istio
@@ -506,17 +507,36 @@ message LoadBalancerSettings {
506507
// between this object and the object one in MeshConfig
507508
LocalityLoadBalancerSetting locality_lb_setting = 3;
508509

509-
// Represents the warmup duration of Service. If set, the newly created endpoint of service
510+
// Deprecated: use `warmup` instead.
511+
google.protobuf.Duration warmup_duration_secs = 4;
512+
513+
// Represents the warmup configuration of Service. If set, the newly created endpoint of service
510514
// remains in warmup mode starting from its creation time for the duration of this window and
511515
// Istio progressively increases amount of traffic for that endpoint instead of sending proportional amount of traffic.
512516
// This should be enabled for services that require warm up time to serve full production load with reasonable latency.
513517
// Please note that this is most effective when few new endpoints come up like scale event in Kubernetes. When all the
514518
// endpoints are relatively new like new deployment, this is not very effective as all endpoints end up getting same
515519
// amount of requests.
516520
// Currently this is only supported for ROUND_ROBIN and LEAST_REQUEST load balancers.
517-
google.protobuf.Duration warmup_duration_secs = 4;
521+
WarmupConfiguration warmup = 5;
518522
}
519523

524+
message WarmupConfiguration {
525+
// Duration of warmup mode
526+
google.protobuf.Duration duration = 1 [(google.api.field_behavior) = REQUIRED];
527+
528+
// Configures the minimum percentage of origin weight
529+
// If unspecified, defaults to 10
530+
// +kubebuilder:validation:Maximum=100
531+
// +kubebuilder:validation:Minimum=0
532+
google.protobuf.DoubleValue minimum_percent = 2;
533+
534+
// This parameter controls the speed of traffic increase over the warmup duration. Defaults to 1.0, so that endpoints would
535+
// get linearly increasing amount of traffic. When increasing the value for this parameter,
536+
// the speed of traffic ramp-up increases non-linearly.
537+
// +kubebuilder:validation:Minimum=1
538+
google.protobuf.DoubleValue aggression = 3;
539+
}
520540
// Connection pool settings for an upstream host. The settings apply to
521541
// each individual host in the upstream service. See Envoy's [circuit
522542
// breaker](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/circuit_breaking)

networking/v1alpha3/destination_rule_deepcopy.gen.go

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1alpha3/destination_rule_json.gen.go

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1beta1/destination_rule_alias.gen.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: release-notes/v2
2+
3+
kind: feature
4+
area: traffic-management
5+
issue:
6+
- 3215
7+
8+
releaseNotes:
9+
- |
10+
**Added** aggression and minimum_percent parameters
11+
12+
docs:
13+
- https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/slow_start
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
_err: 'spec.trafficPolicy.loadBalancer.warmup.minimumPercent: Invalid value'
2+
apiVersion: networking.istio.io/v1
3+
kind: DestinationRule
4+
metadata:
5+
name: bookinfo-ratings
6+
spec:
7+
host: ratings.prod.svc.cluster.local
8+
trafficPolicy:
9+
loadBalancer:
10+
warmup:
11+
duration: 300s
12+
minimumPercent: 150.0
13+
---
14+
_err: 'spec.trafficPolicy.loadBalancer.warmup.duration: Required value'
15+
apiVersion: networking.istio.io/v1
16+
kind: DestinationRule
17+
metadata:
18+
name: bookinfo-ratings
19+
spec:
20+
host: ratings.prod.svc.cluster.local
21+
trafficPolicy:
22+
loadBalancer:
23+
warmup:
24+
minimumPercent: 5.0
25+
---
26+
_err: 'spec.trafficPolicy.loadBalancer.warmup.aggression: Invalid value'
27+
apiVersion: networking.istio.io/v1
28+
kind: DestinationRule
29+
metadata:
30+
name: bookinfo-ratings
31+
spec:
32+
host: ratings.prod.svc.cluster.local
33+
trafficPolicy:
34+
loadBalancer:
35+
warmup:
36+
duration: 300s
37+
aggression: 0.3
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: networking.istio.io/v1
2+
kind: DestinationRule
3+
metadata:
4+
name: bookinfo-ratings
5+
spec:
6+
host: ratings.prod.svc.cluster.local
7+
trafficPolicy:
8+
loadBalancer:
9+
warmup:
10+
duration: 300s
11+
---
12+
apiVersion: networking.istio.io/v1
13+
kind: DestinationRule
14+
metadata:
15+
name: bookinfo-ratings
16+
spec:
17+
host: ratings.prod.svc.cluster.local
18+
trafficPolicy:
19+
loadBalancer:
20+
warmup:
21+
duration: 300s
22+
minimumPercent: 5.0
23+
---
24+
apiVersion: networking.istio.io/v1
25+
kind: DestinationRule
26+
metadata:
27+
name: bookinfo-ratings
28+
spec:
29+
host: ratings.prod.svc.cluster.local
30+
trafficPolicy:
31+
loadBalancer:
32+
warmup:
33+
duration: 300s
34+
minimumPercent: 5.0
35+
aggression: 5.0

0 commit comments

Comments
 (0)