用于装载 Azure Blob 容器共享的 Yaml 配置



如何在 Yaml 上配置 Azure Blob 存储容器

- 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

在我从上面的帖子中得到回复并浏览了在线文章之后,我看到 Azure Blob 没有选项可以装载到 Azure AKS 上,除了使用 azcopy 或 rest api 集成来解决我的问题,考虑到我对环境的限制。

因此,经过一些研究并从下面的文章中获取参考,我可以创建一个Docker映像。

1.( 使用参考文章创建了 docker 映像。但同样,我还需要支持来运行 bash 脚本,因为我正在使用 bash 文件运行 azcopy 命令。因此,我尝试将azcopy工具复制到/usr/bin。

2.( 为 Azure 文件共享和 Azure Blob 创建了 SAS 令牌。(确保仅授予所需的访问权限(

3.( 创建了一个运行以下命令的 bash 文件。

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

4.( 创建了在 AKS 上运行的部署 yaml。添加了在其中运行 bash 文件的命令。

这使我能够将文件从 Azure 文件共享文件夹复制到 Azure Blob 容器

引用:

1.( https://learn.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

最新更新