Not able to mount persistent volume in AKS with Azure File share

Kailash 51 Reputation points
2022-02-04T13:31:54.117+00:00

Hello,
I am trying to provision some resources in Azure via terraform. With jenkins helm chart, I want to provision persistent storage that will be used by the jenkins application. All done via terraform.

I am able to create azure storage account, file share successfully as well as the persistent volume and the corresponding volume claims. Then I try to install the jenkins helm release.

It fails with the following error -

Warning: Helm release "jenkins-poc" was created but has a failed status. Use the helm command to investigate the error, correct it, then run Terraform again.

Here is what I see when I check the logs -

kubectl get events -n jenkins-poc --sort-by='.lastTimestamp'

5m37s Warning FailedMount pod/jenkins-poc-0 (combined from similar events): MountVolume.SetUp failed for volume "jenkins-pocpv" : Couldn't get secret default/***********************************************************
4m15s Warning FailedCreate statefulset/jenkins-poc create Pod jenkins-poc-0 in StatefulSet jenkins-poc failed error: The POST operation against Pod could not be completed at this time, please try again.
4m13s Normal SuccessfulCreate statefulset/jenkins-poc create Pod jenkins-poc-0 in StatefulSet jenkins-poc successful
2m10s Warning FailedMount pod/jenkins-poc-0 Unable to attach or mount volumes: unmounted volumes=[jenkins-home], unattached volumes=[admin-secret jenkins-cache jenkins-home plugins jenkins-poc-token-5rg88 jenkins-config sc-config-volume plugin-dir tmp-volume]: timed out waiting for the condition
4s Warning FailedMount pod/jenkins-poc-0 MountVolume.SetUp failed for volume "jenkins-pocpv" : Couldn't get secret default/**************************************************************

It seems to me that it is complaining about not able to get the secret. This is the secret, I have used when creating the volume that I grabbed from the "Storage account" -> "Access Keys".

Can you please help in resolving this issue?

Best regards

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,178 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,884 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. shiva patpi 13,146 Reputation points Microsoft Employee
    2022-02-05T04:20:17.247+00:00

    Hello @Kailash ,
    What is the version of your AKS? If you are using the lower version of AKS - it might be related to https://github.com/Azure/AKS/issues/2108
    Check out the alternate options mentioned in that above document.

    Can you try using the secrets on the default namespace or use PV which supports name spaced secrets?

    Regards,
    Shiva.


  2. shiva patpi 13,146 Reputation points Microsoft Employee
    2022-02-09T17:41:20.337+00:00

    For the error w.r.t mount failed: exit status 32 and mount error(2): No such file or directory

    Can you check if there is a NSG (Network Security Group) rule blocking TCP Port 445 to your storage account IP Address ?

    Also take a look at this and the example YAML file for mounting using STS https://github.com/Azure/AKS/issues/1906#issuecomment-720480827