From aae3ee9339bec8ecf36f8e1fa56ed79bd15bbdac Mon Sep 17 00:00:00 2001 From: Vladimir Nachev Date: Thu, 9 Jan 2020 20:37:15 +0200 Subject: [PATCH] Azure-CCM: Bundle cloudProviderRateLimitQPS[Write] to the maxNodes Ref: https://github.com/gardener/gardener-extensions/pull/532 ```improvement operator An issue where cloud controller manager was self-rate-limited for azure shoot clusters with more than 10 nodes has been fixed. ``` --- .../templates/cloud-provider-config.tpl | 4 ++-- .../charts/internal/cloud-provider-config/values.yaml | 3 ++- .../pkg/controller/controlplane/valuesprovider.go | 6 ++++++ .../pkg/controller/controlplane/valuesprovider_test.go | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/controllers/provider-azure/charts/internal/cloud-provider-config/templates/cloud-provider-config.tpl b/controllers/provider-azure/charts/internal/cloud-provider-config/templates/cloud-provider-config.tpl index 6c5346a06..f3168bef4 100644 --- a/controllers/provider-azure/charts/internal/cloud-provider-config/templates/cloud-provider-config.tpl +++ b/controllers/provider-azure/charts/internal/cloud-provider-config/templates/cloud-provider-config.tpl @@ -21,9 +21,9 @@ cloudProviderBackoffExponent: 1.5 cloudProviderBackoffDuration: 5 cloudProviderBackoffJitter: 1.0 cloudProviderRateLimit: true -cloudProviderRateLimitQPS: 10.0 +cloudProviderRateLimitQPS: {{ ( max .Values.maxNodes 10 ) }} cloudProviderRateLimitBucket: 100 -cloudProviderRateLimitQPSWrite: 10.0 +cloudProviderRateLimitQPSWrite: {{ ( max .Values.maxNodes 10 ) }} cloudProviderRateLimitBucketWrite: 100 {{- if semverCompare ">= 1.14" .Values.kubernetesVersion }} cloudProviderBackoffMode: v2 diff --git a/controllers/provider-azure/charts/internal/cloud-provider-config/values.yaml b/controllers/provider-azure/charts/internal/cloud-provider-config/values.yaml index 3e8921d72..6be1e7675 100644 --- a/controllers/provider-azure/charts/internal/cloud-provider-config/values.yaml +++ b/controllers/provider-azure/charts/internal/cloud-provider-config/values.yaml @@ -9,4 +9,5 @@ vnetName: name subnetName: sname routeTableName: rtname securityGroupName: sgname -region: location \ No newline at end of file +region: location +maxNodes: 0 \ No newline at end of file diff --git a/controllers/provider-azure/pkg/controller/controlplane/valuesprovider.go b/controllers/provider-azure/pkg/controller/controlplane/valuesprovider.go index 0458622b5..27dd012da 100644 --- a/controllers/provider-azure/pkg/controller/controlplane/valuesprovider.go +++ b/controllers/provider-azure/pkg/controller/controlplane/valuesprovider.go @@ -213,6 +213,11 @@ func getConfigChartValues( return nil, errors.Wrapf(err, "could not determine subnet, availability set, route table or security group name from infrastructureStatus of controlplane '%s'", util.ObjectName(cp)) } + var maxNodes int32 + for _, worker := range cluster.Shoot.Spec.Provider.Workers { + maxNodes = maxNodes + worker.Maximum + } + // Collect config chart values. values := map[string]interface{}{ "kubernetesVersion": cluster.Shoot.Spec.Kubernetes.Version, @@ -226,6 +231,7 @@ func getConfigChartValues( "routeTableName": routeTableName, "securityGroupName": securityGroupName, "region": cp.Spec.Region, + "maxNodes": maxNodes, } if infraStatus.Networks.VNet.ResourceGroup != nil { diff --git a/controllers/provider-azure/pkg/controller/controlplane/valuesprovider_test.go b/controllers/provider-azure/pkg/controller/controlplane/valuesprovider_test.go index f46b86c7f..3c12548c9 100644 --- a/controllers/provider-azure/pkg/controller/controlplane/valuesprovider_test.go +++ b/controllers/provider-azure/pkg/controller/controlplane/valuesprovider_test.go @@ -38,7 +38,8 @@ import ( ) const ( - namespace = "test" + namespace = "test" + maxNodes int32 = 0 ) var _ = Describe("ValuesProvider", func() { @@ -450,6 +451,7 @@ var _ = Describe("ValuesProvider", func() { "routeTableName": "route-table-name", "securityGroupName": "security-group-name-workers", "kubernetesVersion": "1.13.4", + "maxNodes": maxNodes, } configZonedClusterChartValues = map[string]interface{}{ @@ -464,6 +466,7 @@ var _ = Describe("ValuesProvider", func() { "routeTableName": "route-table-name", "securityGroupName": "security-group-name-workers", "kubernetesVersion": "1.13.4", + "maxNodes": maxNodes, } ccmChartValues = map[string]interface{}{