如何在 Azure 容器執行個體上掛載 NFS 共用

如何在 Azure 容器執行個體上掛載 NFS 共用

我已註冊 Azure 檔案 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。

相關內容