Yaml configuration to mount Azure Blob Container share

6/4/2020

How to configure Azure Blob Storage Container on an Yaml

   - name: scripts-file-share
     azureFile:
         secretName: dev-blobstorage-secret
         shareName: logs
         readOnly: false```

The above is for the logs file share to configure on yaml.
But if I need to mount blob container? How to configure it?

Instead of azureFile do I need to use azureBlob?
And what is the configuration that I need to have below azureBlob? Please help
-- SkyArc
azure
azure-blob-storage
kubernetes
yaml

1 Answer

6/14/2020

After the responses I got from the above post and also went through the articles online, I see there is no option for Azure Blob to mount on Azure AKS except to use azcopy or rest api integration for my problem considering the limitations I have on my environment.

So, after little bit research and taking references from below articles I could able to create a Docker image.

1.) Created the docker image with the reference article. But again, I also need support to run a bash script as I am running azcopy command using bash file. So, I tried to copy the azcopy tool to /usr/bin.

2.) Created SAS tokens for Azure File Share & Azure Blob. (Make sure you give required access permissions only)

3.) Created a bash file that runs the below command.

azcopy <FileShareSASTokenConnectionUrl> <BlobSASTokenConnectionUrl> --recursive=true

4.) Created a deployment yaml that runs on AKS. Added the command to run bash file in that.

This gave me the ability to copy the files from Azure File Share Folders to Azure Blob Container

References:

1.) https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?toc=%2fazure%2fstorage%2fblobs%2ftoc.json#obtain-a-static-download-link

2.) https://github.com/Azure/azure-storage-azcopy/issues/423

-- SkyArc
Source: StackOverflow