Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

cannot create AKSCluster: length of the node resource group name is too long #26

Open
prasek opened this issue May 7, 2020 · 2 comments

Comments

@prasek
Copy link
Member

prasek commented May 7, 2020

Problem

Creating the an AzureSample and WordpressInstance results in the following error:

status:
  conditions:
    - lastTransitionTime: '2020-05-07T20:32:42Z'
      reason: Resource is being created
      status: 'False'
      type: Ready
    - lastTransitionTime: '2020-05-07T20:32:54Z'
      message: >-
        create failed: cannot create AKSCluster:
        containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending
        request: StatusCode=400 -- 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 85. Please
        see https://aka.ms/aks-naming-rules for more details." Target="name"
      reason: Encountered an error during resource reconciliation
      status: 'False'
      type: Synced

Using:

  • Crossplane 0.10.0
  • Azure Providerv0.9.0
  • Azure Sample Stack v0.5.0
  • Wordpress v0.4.0
WordpressInstance CR
apiVersion: wordpress.apps.crossplane.io/v1alpha1
kind: WordpressInstance
metadata:
  creationTimestamp: '2020-05-07T20:32:39Z'
  generation: 1
  name: rebel-alliance-may7-azure2-ws1-wp1
  namespace: rebel-alliance-may7-azure2-ws1
  resourceVersion: '17622'
  selfLink: >-
    /apis/wordpress.apps.crossplane.io/v1alpha1/namespaces/rebel-alliance-may7-azure2-ws1/wordpressinstances/rebel-alliance-may7-azure2-ws1-wp1
  uid: e393d26e-6e9f-41f6-9022-574ffa29b302
spec:
  provisionPolicy: ProvisionNewCluster
status:
  conditions:
    - lastTransitionTime: '2020-05-07T20:32:40Z'
      reason: Successfully reconciled resource
      status: 'True'
      type: Synced
AzureSample CR
apiVersion: azure.stacks.crossplane.io/v1alpha1
kind: AzureSample
metadata:
  creationTimestamp: '2020-05-07T20:28:59Z'
  generation: 1
  name: rebel-alliance-may7-azure2
  resourceVersion: '16236'
  selfLink: >-
    /apis/azure.stacks.crossplane.io/v1alpha1/azuresamples/rebel-alliance-may7-azure2
  uid: 2ac6a163-1ac5-4a32-8a8c-99c782d7eedb
spec:
  credentialsSecretRef:
    key: credentialsKeyBody
    name: azuresamples.azure.stacks.crossplane.io-rebel-alliance-may7-azure2
    namespace: crossplane-system
  location: West US
status:
  conditions:
    - lastTransitionTime: '2020-05-07T20:29:03Z'
      reason: Successfully reconciled resource
      status: 'True'
      type: Synced
AKSCluster
apiVersion: compute.azure.crossplane.io/v1alpha3
kind: AKSCluster
metadata:
  annotations:
    crossplane.io/external-name: rebel-alliance-may7-azure2-ws1-wp1
  creationTimestamp: '2020-05-07T20:32:41Z'
  finalizers:
    - finalizer.managedresource.crossplane.io
  generateName: rebel-alliance-may7-azure2-ws1-rebel-alliance-may7-azure2-ws1-wp1-cluster-
  generation: 2
  name: rebel-alliance-may7-azure2-ws1-rebel-alliance-may7-azure2-8sjl4
  resourceVersion: '17743'
  selfLink: >-
    /apis/compute.azure.crossplane.io/v1alpha3/aksclusters/rebel-alliance-may7-azure2-ws1-rebel-alliance-may7-azure2-8sjl4
  uid: d36da44c-9987-4bbc-af67-24cc17b06920
spec:
  claimRef:
    apiVersion: compute.crossplane.io/v1alpha1
    kind: KubernetesCluster
    name: rebel-alliance-may7-azure2-ws1-wp1-cluster
    namespace: rebel-alliance-may7-azure2-ws1
    uid: 4db97528-63a2-43cf-a520-f3beea51aceb
  classRef:
    apiVersion: compute.azure.crossplane.io/v1alpha3
    kind: AKSClusterClass
    name: rebel-alliance-may7-azure2-akscluster
    uid: a911602c-4b62-4d3b-ad61-79a4ea6421ad
  dnsNamePrefix: crossplane-aks
  location: West US
  nodeCount: 1
  nodeVMSize: Standard_B2s
  providerRef:
    name: rebel-alliance-may7-azure2-azure-provider
  reclaimPolicy: Delete
  resourceGroupName: rebel-alliance-may7-azure2-resourcegroup
  resourceGroupNameRef:
    name: rebel-alliance-may7-azure2-resourcegroup
  version: 1.14.8
  vnetSubnetID: >-
    /subscriptions/038f2b7c-3265-43b8-8624-c9ad5da610a8/resourceGroups/rebel-alliance-may7-azure2-resourcegroup/providers/Microsoft.Network/virtualNetworks/rebel-alliance-may7-azure2-virtualnetwork/subnets/rebel-alliance-may7-azure2-subnet
  vnetSubnetIDRef:
    name: rebel-alliance-may7-azure2-subnet
  writeConnectionSecretToRef:
    name: 4db97528-63a2-43cf-a520-f3beea51aceb
    namespace: crossplane-system
status:
  conditions:
    - lastTransitionTime: '2020-05-07T20:32:42Z'
      reason: Resource is being created
      status: 'False'
      type: Ready
    - lastTransitionTime: '2020-05-07T20:32:54Z'
      message: >-
        create failed: cannot create AKSCluster:
        containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending
        request: StatusCode=400 -- 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 85. Please
        see https://aka.ms/aks-naming-rules for more details." Target="name"
      reason: Encountered an error during resource reconciliation
      status: 'False'
      type: Synced
  endpoint: ''
ResourceGroup
apiVersion: azure.crossplane.io/v1alpha3
kind: ResourceGroup
metadata:
  annotations:
    crossplane.io/external-name: rebel-alliance-may7-azure2-resourcegroup
  creationTimestamp: '2020-05-07T20:29:02Z'
  finalizers:
    - finalizer.managedresource.crossplane.io
  generation: 1
  labels:
    core.crossplane.io/parent-group: azure.stacks.crossplane.io
    core.crossplane.io/parent-kind: AzureSample
    core.crossplane.io/parent-name: rebel-alliance-may7-azure2
    core.crossplane.io/parent-namespace: ''
    core.crossplane.io/parent-version: v1alpha1
  name: rebel-alliance-may7-azure2-resourcegroup
  ownerReferences:
    - apiVersion: azure.stacks.crossplane.io/v1alpha1
      blockOwnerDeletion: true
      kind: AzureSample
      name: rebel-alliance-may7-azure2
      uid: 2ac6a163-1ac5-4a32-8a8c-99c782d7eedb
  resourceVersion: '16303'
  selfLink: >-
    /apis/azure.crossplane.io/v1alpha3/resourcegroups/rebel-alliance-may7-azure2-resourcegroup
  uid: 568fc088-9a3c-4792-bec5-ea4d9aa95439
spec:
  location: West US
  providerRef:
    name: rebel-alliance-may7-azure2-azure-provider
  reclaimPolicy: Delete
status:
  conditions:
    - lastTransitionTime: '2020-05-07T20:29:12Z'
      reason: Resource is available for use
      status: 'True'
      type: Ready
    - lastTransitionTime: '2020-05-07T20:29:12Z'
      reason: Successfully reconciled resource
      status: 'True'
      type: Synced
  provisioningState: Succeeded

Related

@prasek
Copy link
Member Author

prasek commented May 7, 2020

@muvaf can we apply the technique you used in https://github.com/crossplane/app-wordpress/pull/53/files to resourcegroup.yaml?

@muvaf
Copy link
Member

muvaf commented May 7, 2020

I think we're going to land on a solution for all in crossplane-contrib/provider-gcp#222 . However, note that this is different than crossplane-contrib/provider-gcp#222 . We can't set the max length to be compatible with just AKSCluster; if Azure allows ResourceGroup to be created with a longer name than AKSCluster accepts, then we allow it, too. So, we'll decrease the likelihood and probably make our name generator more robust but the validation we'll aim will be the ResourceGroup's name validation, not AKSCluster's resource group name field validation.

If we can't decide on something, then it could make sense to go with the approach that we took in app-wordpress for the release. Though I don't think we'll have to.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants