小编Kir*_*kiy的帖子

Terraform Kubernetes 供应商“local-exec” kubectl apply -f -<<EOF 在 Windows 上不起作用

我正在尝试 通过 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)

yaml kubernetes terraform kubectl

1
推荐指数
1
解决办法
1575
查看次数

标签 统计

kubectl ×1

kubernetes ×1

terraform ×1

yaml ×1