AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Warning, when provisioning AKS with custom subnet.

Open Nuke1234 opened this issue 8 years ago • 26 comments

Hello!

Getting some new wired output when trying to provisoning an AKS.

'''

Waiting for AAD role to propagate[### ] 10.0000% Waiting for AAD role to propagate[####### ] 20.0000% Waiting for AAD role to propagate[########## ] 30.0000% Waiting for AAD role to propagate[############## ] 40.0000% Waiting for AAD role to propagate[################## ] 50.0000% Waiting for AAD role to propagate[##################### ] 60.0000% Waiting for AAD role to propagate[######################### ] 70.0000% Waiting for AAD role to propagate[############################ ] 80.0000% Waiting for AAD role to propagate[################################ ] 90.0000%WARNING: Could not create a role assignment for subnet. Are you an Owner on this subscription? '''

This warning indicates that i have to be owner of the subscription when i want to provision a cluster properly. Is this right?

Nuke1234 avatar Aug 21 '18 14:08 Nuke1234

Hi @Nuke1234,

In order for AKS to securely manage and provision your clusters you should be owner or administrator of the subscription under which you are creating your AKS cluster.

jskulavik avatar Aug 21 '18 15:08 jskulavik

You should really re-think the direction in which you are developing the AKS. To make every service principal who provisions AKS administrator or owner of the subscription is not acceptable.

Nuke1234 avatar Aug 21 '18 17:08 Nuke1234

Thank you for the feedback @Nuke1234. Contributor role should work as well. Does your service principal have that role?

jskulavik avatar Aug 21 '18 18:08 jskulavik

No, it has only access to the resource group where the aks and the vnets are provisioned in and to the log analytics workspace. That should be enough.

Nuke1234 avatar Aug 21 '18 18:08 Nuke1234

Contributor role dose not suffice either. Waiting for AAD role to propagate[################################ ] 90.0000%Could not create a role assignment for subnet. Are you an Owner on this subscription?

Seems to work using the portal or maybe it is silently complaining about the same thing there.

For reference. I'm trying to setup a aks cluster with advanced networking and using an sp created with this command: az ad sp create-for-rbac --skip-assignment Ref. https://docs.microsoft.com/en-us/azure/aks/kubernetes-service-principal#pre-create-a-new-sp

caleno avatar Sep 17 '18 09:09 caleno

I'm having the exact same issue. I'm a subscription owner and having the same issue. For reference I'm using an RBAC enabled cluster with Advanced networking (having the cluster sit in a custom vNet):

Waiting for AAD role to propagate[################################ ] 90.0000%Could not create a role assignment for subnet. Are you an Owner on this subscription? Deployment failed. Correlation ID: xxxxxxxxxx. Provisioning of resource(s) for container service aksInfraDev in resource group InfraDev failed. Message: Operation results in exceeding quota limits of Core. Maximum allowed: 10, Current in use: 6, Additional requested: 6. Please read more about quota increase at http://aka.ms/corequotaincrease.. Details:

justinhauer avatar Sep 20 '18 14:09 justinhauer

Having the same issue.

Waiting for AAD role to propagate[################################    ]  90.0000%Could not create a role assignment for subnet. Are you an Owner on this subscription?

Not sure about whos role it is complaining though? Does this error mean that the SPN can't claim the right permissions?

I see the SPN getting created, and I end up with a working AKS cluster as well, but that seems to be unable to instruct the vnet to get the right Service-IPs delegated..

Using AZ CLI:

az aks create --resource-group RGROUP \
--name AKSCLUSTER2 \
--vnet-subnet-id /bla/resourceGroups/RGROUP/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/AKSCLUSTER2-subnet --network-plugin azure \
--docker-bridge-address 169.254.0.1/16 \
--dns-service-ip 172.21.6.10 \
--service-cidr 172.21.6.0/24 \
--kubernetes-version 1.10.6 \
--no-ssh-key \
--no-wait \
--node-count 2 \
--node-vm-size Standard_D2s_v3 \
--max-pods 60 \
--aad-server-app-id 1111 \
--aad-server-app-secret 2222 \
--aad-client-app-id 3333\
--aad-tenant-id 44444 \
--enable-addons monitoring

sdktr avatar Sep 24 '18 22:09 sdktr

@jskulavik As this is still a problem, maybe it is time to re-open this issue?

For reference: I am creating a cluster with --network-plugin azure and have the Contributor role and get the message:

Could not create a role assignment for subnet. Are you an Owner on this subscription?

I am using the azure-cli 2.0.46

zommarin avatar Oct 02 '18 19:10 zommarin

I agree. I am having the same issue, and only way to bypass this error is to manually assign the cluster SP to the subnet as Network Contributor (this is what the command is trying to do under the hood). It is not enough to assign the SP at subscription / resource group or VNET, I had to explicitly set it on the subnet itself.

In the end, I don't get how can I assign the SP as network contributor through the portal, but under same account (my account) with azure cli it does not work @jskulavik ?

DenisBiondic avatar Oct 10 '18 07:10 DenisBiondic

I'll comment on this a bit later, talking to the AKS team it's not a common problem but it comes up

On Mon, Sep 24, 2018, 5:02 PM Stefan de Kooter [email protected] wrote:

Having the same issue.

Waiting for AAD role to propagate[################################ ] 90.0000%Could not create a role assignment for subnet. Are you an Owner on this subscription?

Not sure about whos role it is complaining though? Does this error mean that the SPN can't claim the right permissions?

I see the SPN getting created, and I end up with a working AKS cluster as well, but that seems to be unable to instruct the vnet to get the right Service-IPs delegated..

Using AZ CLI:

az aks create --resource-group RGROUP
--name AKSCLUSTER2
--vnet-subnet-id /bla/resourceGroups/RGROUP/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/AKSCLUSTER2-subnet --network-plugin azure
--docker-bridge-address 169.254.0.1/16
--dns-service-ip 172.21.6.10
--service-cidr 172.21.6.0/24
--kubernetes-version 1.10.6
--no-ssh-key
--no-wait
--node-count 2
--node-vm-size Standard_D2s_v3
--max-pods 60
--aad-server-app-id 1111
--aad-server-app-secret 2222
--aad-client-app-id 3333
--aad-tenant-id 44444
--enable-addons monitoring

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Azure/AKS/issues/614#issuecomment-424140364, or mute the thread https://github.com/notifications/unsubscribe-auth/ASXGZYErUU8p5Gt0yyNjK1c0uzf0Sp3rks5ueVZfgaJpZM4WF1Wl .

justinhauer avatar Oct 10 '18 10:10 justinhauer

Same issue here. We don't give SP's rights on subscription level, only on Resource Groups. I gave the SP contributor rights on the RG of the cluster and the RG of the custom vnet but that doesn't help. Will try if being owner on the RG of the custom vnet makes any difference.

bramvdklinkenberg avatar Oct 12 '18 07:10 bramvdklinkenberg

I gave the SP owner rights on the resource group where the custom vnet is in and then it works with role propagation.

bramvdklinkenberg avatar Oct 12 '18 07:10 bramvdklinkenberg

Worked when I got User Access Administrator on the resource group used to setup AKS.

caleno avatar Nov 08 '18 12:11 caleno

Shoudn't it be enough for the az aks create command to add Network Contributor rights on the subnet, in this case Owner is needed only on the Resource Group, not on the whole Subscription. Requiring owner on whole subscription is unrealistic requirement.

whut avatar Aug 30 '19 12:08 whut

Any word on this?

ecoffman avatar Sep 23 '19 13:09 ecoffman

When I tried creating aks cluster using kubenet plugin and custom vNet I got the above mentioned error : Could not create a role assignment for subnet. Are you an Owner on this subscription? Deployment failed. Correlation ID: xxxxxx-xxx-xx-xx-xx. All nodes did not reach Ready state. Expected: 2, Actual: 0 The service principle has roleassignment permissions on the ResourceGroup on which the AKS is created. However it doesn't have permissions on the ResourceGroup of the vNet.

  1. Do i need to grant 'roleassignment' permissions for the service principle on the ResourceGroup of the vNET?
  2. Do I need to give the service principle Network Contributor rights on the subnet

Can you please clarify which one is required?

jpushpanathan avatar Nov 05 '19 21:11 jpushpanathan

Im haveing the same issue now... any update?

Waiting for AAD role to propagate[################################ ] 90.0000%Could not create a role assignment for subnet. Are you an Owner on this subscription? Waiting for AAD role to propagate[################################ ] 90.0000%Could not create a role assignment for ACR. Are you an Owner on this subscription?

when calling with az aks create -g $aksrg -n $aks --attach-acr $registry --network-plugin azure --vnet-subnet-id $akssnid --service-cidr $aks_srv_cidr --dns-service-ip $aks_srv_dns --enable-addons monitoring --workspace-resource-id $logworkspaceid --node-vm-size Standard_A2_v2 --nodepool-name "a2v2node" --network-policy azure --aad-server-app-id $serverApplicationId --aad-server-app-secret $serverApplicationSecret --aad-client-app-id $clientApplicationId --aad-tenant-id $tenantId --generate-ssh-keys --admin-username pciaksadmin

AlexanderViken avatar Jan 13 '20 07:01 AlexanderViken

I have exactly the same issue. Is there any news on this?

Waiting for AAD role to propagate[################################ ] 90.0000% Could not create a role assignment for subnet. Are you an Owner on this subscription?

bas-velthuizen avatar Jan 15 '20 15:01 bas-velthuizen

same here !

I'm both, admin and owner

Waiting for AAD role to propagate[################################ ] 90.0000%Could not create a role assignment for ACR. Are you an Owner on this subscription?

omaratpxt avatar Jan 28 '20 09:01 omaratpxt

I faced the same issue before, and I've solved my case. In my case, the root issue is due to too small range of subnet(192.168.1.0/26) which was specifed as --vnet-subnet-id of az aks create command. And the command just shows Could not create a role assignment for subnet. Are you an Owner on this subscription? instead of showing the root issue. I've made the subnet range bigger, then an AKS cluster creation succeeded, but still the message Could not create a role assignment for subnet. Are you an Owner on this subscription? is shown. Now I am just ignoring the message.

oomichi avatar Feb 11 '20 19:02 oomichi