【问题标题】:pod identity on aks cluster crreationaks 集群创建时的 pod 身份
【发布时间】:2021-07-28 21:09:11
【问题描述】:

目前,在创建集群时不可能在 arm 模板(和 terraform)上分配用户分配的身份。我已经尝试了很多东西,并且在手动插入后更新效果很好:

az aks pod-identity add --cluster-name my-aks-cn --resource-group myrg --namespace myns --name example-pod-identity --identity-resource-id /subscriptions/......

但是,我想在部署时立即完成此操作,因此我需要将 pod 用户身份自动插入集群。我还尝试使用DeploymentScripts 运行命令,但部署脚本尚未准备好使用preview aks extersion

我的配置如下所示:

    {
      "type": "Microsoft.ContainerService/managedClusters",
      "apiVersion": "2021-02-01",
      "name": "[variables('cluster_name')]",
      "location": "[variables('location')]",
      "dependsOn": [
        "[resourceId('Microsoft.Network/virtualNetworks', variables('vnet_name'))]"
      ],
      "properties": {
....
        "podIdentityProfile": {
        "allowNetworkPluginKubenet": null,
        "enabled": true,
        "userAssignedIdentities": [
            {
            "identity": {
                "clientId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', 'managed-indentity'), '2018-11-30').clientId]",
                "objectId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', 'managed-indentity'), '2018-11-30').principalId]",
                "resourceId": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', 'managed-indentity')]"
            },
            "name": "managed-indentity",
            "namespace": "myns"
            }
        ],
        "userAssignedIdentityExceptions": null
        },
....
      },
      "identity": {
        "type": "SystemAssigned"
      }
    },

我总是遇到同样的问题:

"statusMessage": "{\"error\":{\"code\":\"InvalidTemplateDeployment\",\"message\":\"The template deployment 'deployment_test' is not valid according to the validation procedure. The tracking id is '.....'. See inner errors for details.\",\"details\":[{\"code\":\"PodIdentityAddonUserAssignedIdentitiesNotAllowedInCreation\",\"message\":\"Provisioning of resource(s) for container service cluster-12344 in resource group myrc failed. Message: {\\n \\\"code\\\": \\\"PodIdentityAddonUserAssignedIdentitiesNotAllowedInCreation\\\",\\n \\\"message\\\": \\\"PodIdentity addon does not support assigning pod identities on creation.\\\"\\n }. Details: \"}]}}",

【问题讨论】:

    标签: kubernetes azure-aks aad-pod-identity


    【解决方案1】:

    产品团队在这里分享了答案:https://github.com/Azure/aad-pod-identity/issues/1123

    上面写着:

    这是现有配置中的一个已知限制。我们会修复 这在 V2 实现中。

    对于其他面临相同问题的人,请参阅上面的 GitHub 问题。

    【讨论】:

      猜你喜欢
      • 2022-10-25
      • 2020-09-28
      • 2022-01-22
      • 2019-11-23
      • 1970-01-01
      • 1970-01-01
      • 2021-10-12
      • 2020-05-06
      • 2020-01-17
      相关资源
      最近更新 更多