How to see existing data in Azure storage container mount as AKS pod inline PV?

DV 10 Reputation points
2023-06-01T12:36:26.5933333+00:00

Hi, I have an Azure storage account that has a container named extracted in it, and this container has some folders with data inside as in:
- extracted
- data_1
- data_2
etc.
I have mounted the container as an inline volume in an AKS pod, setup like:

kind: Pod
apiVersion: v1
metadata:
  name: my-name
spec:
  securityContext:
    runAsNonRoot: true
    runAsUser: 1000
    runAsGroup: 1000
    fsGroup: 1000
  containers:
  - image: ...
    name: my-name
    command: ["tail"]
    args:
      [
        "-f",
        "/dev/null"
      ]
    resources:
      ...
    volumeMounts:
      - name: data-1
        mountPath: "/app/data"
        readOnly: false
    env:
		...
  volumes:
    - name: data-1
      csi:
        driver: blob.csi.azure.com
        volumeAttributes:
          containerName: extracted
          secretName: test-secret
          mountOptions: "-o allow_other --file-cache-timeout-in-seconds=120"

and I have a generic secret (type=Opaque) in the same namespace as
azurestorageaccountkey: my-key
azurestorageaccountkey: my-account name

I am able to create the pod and the container is mount in the correct mountPath, but I am not able to see the folders that exist in the container (which I can see from portal.azure GUI).

Moreover I am able to CRUD a new file from the pod (f.e. touch /app/data/newfile.txt; echo "test" > /app/data/newfile.txt; rm /app/data/newfile.txt and this is also available/accessible from both pod and portal.azure GUI) but I am not able to create a new directory (e.g. mkdir /app/data/test results in: "mkdir: cannot create directory '/app/data/test': No such file or directory")

I have tried adding "-o umask=777" or "-o umask=0777" to my spec.volumes.csi.volumeAttributes.mountOptions string but to no avail.

Is it possible (and how) to be able to see existing dirs and create new dirs in my mount-as-volume storage container?
Please let me know if I should add more details.
Thanks!

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,943 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.
2,165 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.