rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
463 stars 262 forks source link

Unable to deploy AKS cluster due to Rancher generating and appending characters to the node resource group which is too long #8980

Closed kkaempf closed 1 year ago

kkaempf commented 1 year ago

SURE-4913

Issue description:

Customer is unable to deploy AKS cluster due to Rancher generating and appending characters to the cluster name 

Business impact:

Unable to deploy AKS cluster using Rancher. 

Troubleshooting steps:

From Rancher UI we do not have an option to provide a node resource group name. Rancher in the backend automatically generates characters and appends them with the name provided in the cluster resource group and creates a node resource group name that is too long. 

Error failed to create cluster: containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidParameter" Message="The length of the node resource group name is too long. The maximum length is 80 and the length of the value provided is 87. Please see https://aka.ms/aks-naming-rules for more details." Target="name" 

We can create an AKS cluster with a shorter name but this is against the naming conventions of CLASS infrastructure.  Example the resource-group CLASS specified was "RG-Test-Kafka-RemoteService-AKS-3". Rancher generates characters with cluster name and region name (MCRG-Test-Kafka-RemoteService-AKS-3_) which becomes too long and the cluster deployment fails. 

Repro steps:

Create an AKS cluster with a longer name and also provide a larger cluster resource group name. This will fail the cluster deployment. 

Workaround:

Is a workaround available and implemented? yes   What is the workaround: To provide a shorter name but this cannot be implemented as its against the CLASS naming convention. 

Actual behavior:

The customer is unable to deploy AKS cluster due to Rancher generating and appending characters to the node resource group which is too long.

Expected behavior:

Rancher should provide an option to pass the node resource group name in the Rancher UI while deploying AKS cluster. This option is available in Azure CLI method and the customer is expecting the same from the Rancher side. 

Reference PRs

https://github.com/rancher/aks-operator/issues/207 https://github.com/rancher/aks-operator/pull/210

kkaempf commented 1 year ago

See rancher/aks-operator#207

we have to add the feature to allow passing the node resource group name in the aks-operator and then have a field in the UI for users to input this custom name

salasberryfin commented 1 year ago

rancher/aks-operator#210 adds a new field to the cluster spec in the operator side NodeResourceGroup. We can allow users to set a custom node resource group name for AKS clusters by adding a new field in the UI when creating a new cluster. This field can be optional and must be 80 characters or less in length. If no value is provided for the new spec, the operator uses the default Azure-generated resource group name which is now truncated to the first 80 characters if it exceeds the length limitation.

kwwii commented 1 year ago

We should display an input field with the auto-generated name, and allow the user to replace/edit it. There should be inline field validation to ensure that the string entered by the user adheres to the standard.

cpinjani commented 1 year ago

Able to reproduce this on un-fixed version: image

cpinjani commented 1 year ago

Validated on build:

v2.7-5f2e119ef43aeff14bfd214d49d6ac36b5cdddf5-head
aks-operator:v1.1.2

Tests Results - :white_check_mark:

Test Case Result
Provision downstream AKS cluster with valid Node Resource group value configured :white_check_mark:  
Provision downstream AKS cluster with invalid Node Resource group value configured :x: (Expected)
Provision downstream AKS cluster with Node Resource group value configured with same name as Resource group :x: (Expected)
Provision downstream AKS cluster with blank Node Resource group value configured :white_check_mark:
Provision downstream AKS cluster with blank Node Resource group value configured (Resource group name = 80 characters) :white_check_mark: (Node Resource group created with truncated name)
Provision Rancher on v2.7.3 => upgrade Rancher to v2.7-head => Provision downstream AKS cluster with valid Node Resource group value configured :white_check_mark:

Few issues reported while validation: https://github.com/rancher/dashboard/issues/9416, https://github.com/rancher/dashboard/issues/9433, https://github.com/rancher/terraform-provider-rancher2/issues/1178