我正在使用azure am,并使用terraform模块部署它,我已经成功执行了。以下是以下文档。
https://www.hashicorp.com/blog/kubernetes-cluster-with-aks-and-terraform
但问题是,我想保存kubeconfig的管理员user.Below是我写的代码。我无法获取管理员用户的kubeconfig文件。
==============================================
resource "null_resource" "kubeconfig_save" {
provisioner "local-exec" {
command = <<EOT
rm -rf /tmp/kubeconfig && \
echo "${azurerm_kubernetes_cluster.k8s.kube_config_raw}" > /tmp/kubeconfig
EOT
}
}
==================================================我需要管理员用户的kubeconfig。
发布于 2018-12-10 19:25:48
你可以这样做:
output "kubeConfig" {
value = "${azurerm_kubernetes_cluster.k8s.kube_config_raw}"
}如果这不起作用,可以尝试像this示例那样输出它。
然后运行:
terraform output kubeConfig > file.tmphttps://stackoverflow.com/questions/53704576
复制相似问题