From a4fd6f692d440c6afe225f6234920eb1965802b0 Mon Sep 17 00:00:00 2001 From: Zsolt Varga Date: Wed, 2 Feb 2022 15:04:46 +0100 Subject: [PATCH] address review comments --- api/v1alpha1/common.gen.json | 4 ++-- api/v1alpha1/common.pb.go | 6 +++--- api/v1alpha1/common.pb.html | 6 +++--- api/v1alpha1/common.proto | 6 +++--- api/v1alpha1/istiocontrolplane.gen.json | 4 ++-- api/v1alpha1/istiomeshgateway.gen.json | 4 ++-- .../manifests/istio-discovery/templates/autoscale.yaml | 2 +- .../manifests/istio-meshgateway/templates/autoscale.yaml | 2 +- internal/assets/manifests/istio-meshgateway/values.yaml | 1 + 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/api/v1alpha1/common.gen.json b/api/v1alpha1/common.gen.json index f12556fdb..ad4f1e0d6 100644 --- a/api/v1alpha1/common.gen.json +++ b/api/v1alpha1/common.gen.json @@ -319,12 +319,12 @@ "nullable": true }, "max": { - "description": "max is the upper limit for the number of replicas to which the autoscaler can scale up. min and max both needs to be set the turn on autoscaling. It cannot be less that min.", + "description": "max is the upper limit for the number of replicas to which the autoscaler can scale up. min and max both need to be set the turn on autoscaling. It cannot be less than min.", "type": "integer", "nullable": true }, "min": { - "description": "min is the lower limit for the number of replicas to which the autoscaler can scale down. min and max both needs to be set the turn on autoscaling.", + "description": "min is the lower limit for the number of replicas to which the autoscaler can scale down. min and max both need to be set the turn on autoscaling.", "type": "integer", "nullable": true }, diff --git a/api/v1alpha1/common.pb.go b/api/v1alpha1/common.pb.go index 571b9c8dc..07f0dee77 100644 --- a/api/v1alpha1/common.pb.go +++ b/api/v1alpha1/common.pb.go @@ -1471,12 +1471,12 @@ type Replicas struct { Count *int32 `protobuf:"bytes,1,opt,name=count,proto3,wktptr" json:"count,omitempty"` // min is the lower limit for the number of replicas to which the autoscaler // can scale down. - // min and max both needs to be set the turn on autoscaling. + // min and max both need to be set the turn on autoscaling. // +kubebuilder:validation:Minimum=0 Min *int32 `protobuf:"bytes,2,opt,name=min,proto3,wktptr" json:"min,omitempty"` // max is the upper limit for the number of replicas to which the autoscaler can scale up. - // min and max both needs to be set the turn on autoscaling. - // It cannot be less that min. + // min and max both need to be set the turn on autoscaling. + // It cannot be less than min. // +kubebuilder:validation:Minimum=1 Max *int32 `protobuf:"bytes,3,opt,name=max,proto3,wktptr" json:"max,omitempty"` // target average CPU utilization (represented as a percentage of requested CPU) over all the pods; diff --git a/api/v1alpha1/common.pb.html b/api/v1alpha1/common.pb.html index f9bab280f..88cb96736 100644 --- a/api/v1alpha1/common.pb.html +++ b/api/v1alpha1/common.pb.html @@ -1275,7 +1275,7 @@

Replicas

min is the lower limit for the number of replicas to which the autoscaler can scale down. -min and max both needs to be set the turn on autoscaling. +min and max both need to be set the turn on autoscaling. +kubebuilder:validation:Minimum=0

@@ -1288,8 +1288,8 @@

Replicas

Int32Value

max is the upper limit for the number of replicas to which the autoscaler can scale up. -min and max both needs to be set the turn on autoscaling. -It cannot be less that min. +min and max both need to be set the turn on autoscaling. +It cannot be less than min. +kubebuilder:validation:Minimum=1

diff --git a/api/v1alpha1/common.proto b/api/v1alpha1/common.proto index abb4e3023..de5d828b9 100644 --- a/api/v1alpha1/common.proto +++ b/api/v1alpha1/common.proto @@ -540,13 +540,13 @@ message Replicas { // min is the lower limit for the number of replicas to which the autoscaler // can scale down. - // min and max both needs to be set the turn on autoscaling. + // min and max both need to be set the turn on autoscaling. // +kubebuilder:validation:Minimum=0 google.protobuf.Int32Value min = 2 [(gogoproto.wktpointer) = true]; // max is the upper limit for the number of replicas to which the autoscaler can scale up. - // min and max both needs to be set the turn on autoscaling. - // It cannot be less that min. + // min and max both need to be set the turn on autoscaling. + // It cannot be less than min. // +kubebuilder:validation:Minimum=1 google.protobuf.Int32Value max = 3 [(gogoproto.wktpointer) = true]; diff --git a/api/v1alpha1/istiocontrolplane.gen.json b/api/v1alpha1/istiocontrolplane.gen.json index 194598a20..b41cb44d5 100644 --- a/api/v1alpha1/istiocontrolplane.gen.json +++ b/api/v1alpha1/istiocontrolplane.gen.json @@ -2313,12 +2313,12 @@ "nullable": true }, "max": { - "description": "max is the upper limit for the number of replicas to which the autoscaler can scale up. min and max both needs to be set the turn on autoscaling. It cannot be less that min.", + "description": "max is the upper limit for the number of replicas to which the autoscaler can scale up. min and max both need to be set the turn on autoscaling. It cannot be less than min.", "type": "integer", "nullable": true }, "min": { - "description": "min is the lower limit for the number of replicas to which the autoscaler can scale down. min and max both needs to be set the turn on autoscaling.", + "description": "min is the lower limit for the number of replicas to which the autoscaler can scale down. min and max both need to be set the turn on autoscaling.", "type": "integer", "nullable": true }, diff --git a/api/v1alpha1/istiomeshgateway.gen.json b/api/v1alpha1/istiomeshgateway.gen.json index 8cd3a0e8f..3247d1629 100644 --- a/api/v1alpha1/istiomeshgateway.gen.json +++ b/api/v1alpha1/istiomeshgateway.gen.json @@ -331,12 +331,12 @@ "nullable": true }, "max": { - "description": "max is the upper limit for the number of replicas to which the autoscaler can scale up. min and max both needs to be set the turn on autoscaling. It cannot be less that min.", + "description": "max is the upper limit for the number of replicas to which the autoscaler can scale up. min and max both need to be set the turn on autoscaling. It cannot be less than min.", "type": "integer", "nullable": true }, "min": { - "description": "min is the lower limit for the number of replicas to which the autoscaler can scale down. min and max both needs to be set the turn on autoscaling.", + "description": "min is the lower limit for the number of replicas to which the autoscaler can scale down. min and max both need to be set the turn on autoscaling.", "type": "integer", "nullable": true }, diff --git a/internal/assets/manifests/istio-discovery/templates/autoscale.yaml b/internal/assets/manifests/istio-discovery/templates/autoscale.yaml index 6cc48b32f..dc44fefd5 100644 --- a/internal/assets/manifests/istio-discovery/templates/autoscale.yaml +++ b/internal/assets/manifests/istio-discovery/templates/autoscale.yaml @@ -19,6 +19,6 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ default 80 .Values.pilot.cpu.targetAverageUtilization }} + targetAverageUtilization: {{ .Values.pilot.cpu.targetAverageUtilization }} --- {{- end }} diff --git a/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml b/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml index 25da5c0f8..c009ea6e6 100644 --- a/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml +++ b/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml @@ -18,6 +18,6 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ default 80 $gateway.replicas.targetCPUUtilizationPercentage }} + targetAverageUtilization: {{ $gateway.replicas.targetCPUUtilizationPercentage }} --- {{- end }} diff --git a/internal/assets/manifests/istio-meshgateway/values.yaml b/internal/assets/manifests/istio-meshgateway/values.yaml index 258d14fda..e403c3a41 100644 --- a/internal/assets/manifests/istio-meshgateway/values.yaml +++ b/internal/assets/manifests/istio-meshgateway/values.yaml @@ -25,6 +25,7 @@ deployment: count: 1 min: 1 max: 1 + targetCPUUtilizationPercentage: 80 resources: limits: cpu: "2"