我正在尝试 通过 Terraform 的 null_resource创建/应用这个 kubectl .yaml 文件https://github.com/Azure/aad-pod-identity/blob/master/deploy/infra/deployment.yaml到 AKS 以安装 Azure AD Pod 标识。它需要部署 Azure 网关入口控制器。将 Windows 10 与 VS Code 结合使用
主要.tf:
data "template_file" "aad_pod" {
template = "${file("${path.module}/templates/aad_pod.yaml")}"
}
resource "null_resource" "aad_pod_deploy" {
triggers = {
manifest_sha1 = "${sha1("${data.template_file.aad_pod.rendered}")}"
}
provisioner "local-exec" {
command = "kubectl apply -f -<<EOF\n${data.template_file.aad_pod.rendered}\nEOF"
}
}
Run Code Online (Sandbox Code Playgroud)
在 terraform apply 之后我有这个错误:
Error: Error running command 'kubectl apply -f -<<EOF
'cutted listing of yaml file'
EOF': exit status 1. Output: << was unexpected …Run Code Online (Sandbox Code Playgroud)