azure - 用于挂载 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 容器
参考:
2.) https://github.com/Azure/azure-storage-azcopy/issues/423
推荐阅读
- c++ - boost::asio::deadline_timer cancel() 方法没有调用定时器处理程序
- typescript - serviceWorker 找不到全局变量
- excel - 在excel中提取姓名
- python - 1个熊猫数据框中的时间序列条件滚动平均值
- amazon-web-services - 如何在无服务器中将 aws 堆栈名称与其他字符串连接起来?
- bash - bash 脚本中“jobs”命令的奇怪行为
- python - 使用 Scrapy 在 .asp 网站上下载所有 pdf 文件时出现问题
- html - 使模式内的引导表可滚动
- azure - 如果发生异常,向 Azure Function Dead-letter-queue 添加其他信息
- ant - 为什么我的单目标 Ant 构建不运行目标?