gpt4 book ai didi

azure - 获取集群 ca 证书 Azure ARM 模板 ManagedClusters

转载 作者:行者123 更新时间:2023-12-02 23:58:44 26 4
gpt4 key购买 nike

如何从某些 ManagedCluster 的 Arm 模板中获取集群 ca 证书?

在 terraform 中我们使用:

azurerm_kubernetes_cluster.aks_cluster.kube_config.0.cluster_ca_certificate

但是在 ARM 中我找不到它。

您能提供一些帮助吗?

谢谢

最佳答案

我的解决方案:

  "resources": [
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2019-10-01-preview",
"name": "get-cluster-ca",
"location": "[resourceGroup().location]",
"identity": {
....
}
},
"kind": "AzureCLI",
"azCliVersion": "2.0.80",
"environmentVariables": [
{
"name": "RESOURCE_GROUP_NAME",
"value": "[resourceGroup().name]"
},
{
"name": "CLUSTER_NAME",
"value": "[variables('cluster_name')]"
}
],
"scriptContent": "#!/bin/bash\r\n\r\naz aks get-credentials --resource-group ${RESOURCE_GROUP_NAME} --name ${CLUSTER_NAME}\r\n\r\naz aks install-cli\r\n\r\necho '{\"ca\":' $(kubectl config view --raw -o json | jq -c '.clusters[0].cluster.\"certificate-authority-data\"') > $AZ_SCRIPTS_OUTPUT_PATH\r\n",
"timeout": "PT30M",
"cleanupPreference": "OnSuccess",
"retentionInterval": "P1D"
}
],
"outputs": {
"result": {
"value": "[reference('get-cluster-ca').outputs.ca]",
"type": "string"
}
}

关于azure - 获取集群 ca 证书 Azure ARM 模板 ManagedClusters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67902778/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com