still issue is there.. working on networking side..
Unable to connect another tenant SMB file share from my Aks cluster
Unable to connect another tenant SMB file share from my Aks cluster
mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg) Attempting to mount //stravisostrgeacc.file.core.windows.net/stravisosmbshare
[9683094.667861] CIFS: Status code returned 0xc0000022 STATUS_ACCESS_DENIED
[9683094.667869] CIFS: VFS: \stravisostrgeacc.file.core.windows.net Send error in SessSetup = -13
[9683094.673082] CIFS: VFS: cifs_mount failed w/return code = -13
Azure Files
Azure Storage Accounts
Azure Kubernetes Service (AKS)
-
Nandamuri Pranay Teja • 160 Reputation points • Microsoft Vendor
2025-01-08T10:05:20.9533333+00:00 Hello Hemabhushan,
Welcome to Microsoft Q&A Forum. Thanks for posting your query here!
I understand that your Unable to connect another tenant SMB file share from Aks cluster.
Further to my investigation i see that the (Error Message: mount error (13): Permission denied) indicates that the service principal used by your AKS cluster lacks the necessary permissions to access the file share in the other tenant.
Firstly, we request you to Verify File Share Permissions of Tenant A Authorization. In Tenant A (where the file share resides), ensure the service principal used by your AKS cluster in Tenant B has the appropriate permissions (e.g., Storage File Contributor or equivalent) to access the file share and also ensure Azure Active Directory (AAD) Configuration, double-check that AAD is configured correctly for cross-tenant access. This might involve granting specific permissions to the service principal in Tenant A's AAD.
We recommend you adhere to the steps outlined below before attempting to connect the tenant to the SMB file share from the AKS cluster.
- If your AKS cluster pod uses a managed identity for accessing resources, confirm that it has the required Azure RBAC permissions to access the file share in Tenant A.
- When mounting the file share, ensure you're providing the correct credentials for the service principal or managed identity with access to the file share. You might need to use a secret or config map to store the credentials securely within the pod.
- Consider using additional options while mounting the file share, such as:
-
vers=3.0
to specify the SMB version (may be required for older SMB servers) -
cifs_username
andcifs_password
to explicitly provide credentials (if not using a managed identity)
-
- Verify that there are no firewall rules within the security groups associated with the storage account or virtual network that might be blocking access from your AKS cluster's subnet.
The above steps should be able to identify the root cause of the permission error and successfully mount the SMB file share from another tenant in your AKS cluster. If you're still encountering the same issue after trying these steps, please helps us with the screenshots to investigate further.
Additional information: Documentation for mounting SMB file shares in AKS pods: https://medium.com/@intruder2021/how-to-mount-folder-from-azure-files-to-a-deployment-in-aks-6de90d11aced
Please let us know you have any further quires. We will be glad to assist you closely.
Please do consider to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
-
Hemabhushan Gottapu • 0 Reputation points
2025-01-08T10:51:02.7+00:00 Hi Teja,
We have configured private endpoint connections for Tenant A's AKS and Tenant B's storage account, and we also provided the necessary permissions for the storage account. However, we are encountering an error while using a Linux script to mount the file share on the pod in Tenant A.
Interestingly, the same script runs without issues on one of the virtual machines, which has its IP address allowed in the storage account's networking settings. In that case, the mounting process works perfectly.
-
Nandamuri Pranay Teja • 160 Reputation points • Microsoft Vendor
2025-01-08T12:05:16.89+00:00 Hello Hemabhushan,
Thank you for the quick response.
I see that you're encountering an error while using a Linux script to mount the file share on the pod in Tenant A.
We request you to kindly check the NSG Rules ensure that the Network Security Groups (NSGs) associated with the subnets of both the AKS cluster in Tenant A and the storage account in Tenant B allow the necessary traffic. Specifically, check for rules that might be blocking SMB traffic on the private endpoint and also Verify that the AKS pods in Tenant A can resolve the private endpoint's FQDN. Check the DNS resolution within the AKS cluster's pods.Regarding the Linux Script and Mounting Options If using service principal credentials, ensure they are correctly stored and accessed within the Linux script. Consider using secrets or environment variables for secure storage. You can check the mount command by reviewing the YAML file used to create the Kubernetes manifest for the pod. Please find the below mounting commands.
- Review the exact
mount
command used in the script - Ensure the correct syntax and options are used
- Verify that the
vers
option (e.g.,vers=3.0
) is specified if required by the SMB server - Consider using options like
cifs_username
andcifs_password
if necessary.
please check the firewall settings on the storage account are not blocking the traffic from your AKS cluster. You can check the firewall settings by opening the Azure portal, navigating to the storage account that contains the file share, and selecting "Firewalls and virtual networks" and Ensure that the permissions on the file share are set up correctly to allow access from the AKS cluster. You can check the permissions by opening the Azure portal, navigating to the storage account that contains the file share, and selecting "Shared access signature".
Please let us know you have any further quires. We will be glad to assist you closely.
- Review the exact
-
Hemabhushan Gottapu • 0 Reputation points
2025-01-08T12:13:22.27+00:00 I'm able to connect the storage from cluster but unable to mount the storage, Allowed the Aks cluster load balancer frontend IPs also.Still i didn't find it where is it blocking.
one more thing ,when i try to follow the same steps on same tenant everything working fine.
-
Nandamuri Pranay Teja • 160 Reputation points • Microsoft Vendor
2025-01-08T15:00:03.54+00:00 Hello Hemabhushan,
Thank you for the kind response!
If the provided steps worked in the same tenant, it might be issue with the cross tenant with improper settings under Tenant A.
We request you to kindly Check if the AKS cluster is configured to use the private DNS zone for resolving the storage account's FQDN and verify DNS resolution within AKS pods using
nslookup
. If using a managed identity, confirm it has the required permissions. Post which use the private endpoint's FQDN in the mount command (e.g.,storage-account-name.privatelink.file.core.windows.net
) and ensure correct credentials are provided in the script (e.g., using secrets or environment variables).- Enable debug logging for the CIFS client on AKS nodes.
- Examine system logs for error messages.
- Use
telnet
ornc
from an AKS pod to test connectivity to the storage account on port 445.
Prerequisites
- Cross-Tenant Security: Prioritize security when accessing resources across tenants.
- Testing: Thoroughly test the mount operation after making changes.
Please refer to the link for reference: https://zcusa.951200.xyz/en-us/troubleshoot/azure/azure-kubernetes/storage/fail-to-mount-azure-file-share#mounterror13
Additional information:
- Identify the Node: Run the following command to identify the node hosting the faulty pod: kubectl get pod -n <namespace> -o wide.
- Check VNET and Subnet: Go to the AKS cluster in the Azure portal, select Properties > Infrastructure resource group, access the virtual machine scale set (VMSS) associated with the node, and check the Virtual network/subnet to identify the VNET and subnet.
- Allow VNET and Subnet: Access the storage account in the Azure portal, select Networking, and ensure that the VNET and subnet of the AKS cluster are allowed under Firewalls and virtual networks. If not, add them.
- Check Network Security Group (NSG): Ensure that the NSG is not blocking traffic between the AKS cluster and the storage account. Use the following commands to check connectivity:
Let me know if you have any concerns we are here at your service.
-
Nandamuri Pranay Teja • 160 Reputation points • Microsoft Vendor
2025-01-09T13:50:02.07+00:00 Hello Hemabhushan,
just checking to see that the above suggestion helped to solve your query. If this answers your question, please Accept the answer or Upvote for the same which helped you. Which might be beneficial to other community members reading this thread. If you have any further query do let us know.
Sign in to comment
1 answer
Sort by: Most helpful
-
Hemabhushan Gottapu • 0 Reputation points
2025-01-09T13:52:55.2166667+00:00 -
Nandamuri Pranay Teja • 160 Reputation points • Microsoft Vendor
2025-01-10T15:58:20.8833333+00:00 Hello Hemabhushan,
Thank you for the kind response!
Please provide us the error snips while you connect another tenant SMB file share from Aks cluster to investigate further on this matter. And i request you to kindly send the error snips and the quarries in the comment box instead of answer box.
Awaiting for your responce!
-
Nandamuri Pranay Teja • 160 Reputation points • Microsoft Vendor
2025-01-13T13:42:03.66+00:00 Hello Hemabhushan,
My apologies for bothering you but, I would like to know if you had the opportunity to look into above comment to provide us the error snips while you connect another tenant SMB file share from Aks cluster to investigate further on this matter.
Awaiting for your responce!
Sign in to comment -