如何在 Azure 容器实例上挂载 NFS 共享

如何在 Azure 容器实例上挂载 NFS 共享

我已注册 Azure Files NFSv4 预览版,但似乎找不到在 ACI 上挂载 NFS 文件共享的方法。我尝试了以下操作:

  1. 在 eastus 中创建了一个虚拟网络,其中包含两个子网,其中一个子网专用于 aci
  2. 更改了 NFS 存储帐户网络以仅允许来自上述 vnet 的连接: 图像
  3. 部署的容器具有以下 json:
     {
       "type": "Microsoft.ContainerInstance/containerGroups",
       "apiVersion": "2019-12-01",
       "location": "eastus",
       "name": "nfs-test",
       "properties": {
         "osType": "Linux",
         "containers": [
           {
             "name": "sshd",
             "properties": {
               "image": "boldidea.azurecr.io/ssh-test",
               "ports": [
                 {
                   "port": 22,
                   "protocol": "TCP"
                 }
               ],
               "resources": {
                 "requests": {
                   "cpu": 1,
                   "memoryInGB": 1.5
                 }
               },
               "volumeMounts": [
                 {
                   "mountPath": "/mnt/user-storage",
                   "name": "user-storage"
                 }
               ]
             }
           }
         ],
         "volumes": [
           {
             "azureFile": {
               "shareName": "ide-user-storage",
               "storageAccountKey": "(redacted)",
               "storageAccountName": "ideworkspacestoragenfs"
             },
             "name": "user-storage"
           }
         ],
         "imageRegistryCredentials": [
           {
             "server": "(redacted)",
             "username": "(redacted)",
             "password": "(redacted)"
           }
         ],
         "ipAddress": {
           "type": "Private",
           "ports": [
             {
               "port": 22,
               "protocol": "TCP"
             }
           ]
         },
         "networkProfile": {
           "id": "/subscriptions/(redacted)/resourceGroups/ideResourceGroup/providers/Microsoft.Network/networkProfiles/aci-network-profile-ide-vnet-eastus-aci"
         }
       }
     }
    

部署挂起大约 30 分钟,然后失败并显示错误“无法装载 Azure 文件卷”。我做错了什么?

答案1

我与 Azure 支持人员讨论了这个问题,并最终联系了 ACI 团队,他们确认 NFS 目前不支持容器实例。

相关内容