Skip to main content
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

准备配置Azure NetApp Files后端

贡献者 netapp-aruldeepa

在配置Azure NetApp Files后端之前,需要确保满足以下要求。

NFS 和 SMB 卷的先决条件

如果您是第一次使用Azure NetApp Files或在新的位置使用,则需要进行一些初始配置来设置 Azure NetApp文件并创建 NFS 卷。参考 "Azure:设置Azure NetApp Files并创建 NFS 卷"

配置和使用 "Azure NetApp Files"后端需要以下组件:

备注
  • subscriptionIDtenantIDclientIDlocation , 和 `clientSecret`在 AKS 集群上使用托管身份时,这些是可选的。

  • tenantIDclientID , 和 `clientSecret`在 AKS 集群上使用云身份时,这些是可选的。

  • 容量池。参考"微软:为Azure NetApp Files创建容量池"

  • 委派给Azure NetApp Files 的子网。参考"Microsoft:将子网委派给Azure NetApp Files"

  • `subscriptionID`来自已启用Azure NetApp Files功能的 Azure 订阅。

  • tenantIDclientID , 和 `clientSecret`来自"应用程序注册"在 Azure Active Directory 中拥有对Azure NetApp Files服务的足够权限。应用程序注册应使用以下任一方式:

    • 所有者或贡献者角色"Azure 预定义"

    • 一个"自定义贡献者角色"订阅级别(assignableScopes)但权限仅限于Trident所需的权限。创建自定义角色后,"使用 Azure 门户分配角色"

      自定义贡献者角色
      {
        "id": "/subscriptions/<subscription-id>/providers/Microsoft.Authorization/roleDefinitions/<role-definition-id>",
        "properties": {
          "roleName": "custom-role-with-limited-perms",
          "description": "custom role providing limited permissions",
          "assignableScopes": [
            "/subscriptions/<subscription-id>"
          ],
          "permissions": [
            {
              "actions": [
                "Microsoft.NetApp/netAppAccounts/capacityPools/read",
                "Microsoft.NetApp/netAppAccounts/capacityPools/write",
                "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/read",
                "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/write",
                "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/delete",
                "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/read",
                "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/write",
                "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/delete",
                "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/MountTargets/read",
                "Microsoft.Network/virtualNetworks/read",
                "Microsoft.Network/virtualNetworks/subnets/read",
                "Microsoft.Features/featureProviders/subscriptionFeatureRegistrations/read",
                "Microsoft.Features/featureProviders/subscriptionFeatureRegistrations/write",
                "Microsoft.Features/featureProviders/subscriptionFeatureRegistrations/delete",
                "Microsoft.Features/features/read",
                "Microsoft.Features/operations/read",
                "Microsoft.Features/providers/features/read",
                "Microsoft.Features/providers/features/register/action",
                "Microsoft.Features/providers/features/unregister/action",
                "Microsoft.Features/subscriptionFeatureRegistrations/read"
              ],
              "notActions": [],
              "dataActions": [],
              "notDataActions": []
            }
          ]
        }
      }
  • 蔚蓝 `location`包含至少一个 "委托子网"。截至Trident 22.01版本, `location`参数是后端配置文件顶层的一个必填字段。虚拟池中指定的位置值将被忽略。

  • 使用 Cloud Identity`得到 `client ID`从一个 "用户分配的托管身份"并指定该 ID `azure.workload.identity/client-id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx

中小企业卷的附加要求

要创建 SMB 卷,您必须具备以下条件:

  • Active Directory 已配置并连接到Azure NetApp Files。参考"Microsoft:创建和管理Azure NetApp Files管理器的 Active Directory 连接"

  • 一个 Kubernetes 集群,包含一个 Linux 控制器节点和至少一个运行 Windows Server 2022 的 Windows 工作节点。 Trident仅支持挂载到运行在 Windows 节点上的 pod 的 SMB 卷。

  • 至少需要一个包含 Active Directory 凭据的Trident密钥,以便Azure NetApp Files可以向 Active Directory 进行身份验证。生成秘密 smbcreds

    kubectl create secret generic smbcreds --from-literal username=user --from-literal password='password'
  • 配置为 Windows 服务的 CSI 代理。要配置 csi-proxy,请参阅"GitHub:CSI代理"或者"GitHub:适用于 Windows 的 CSI 代理"适用于在 Windows 上运行的 Kubernetes 节点。