3

Terraform configuration for heapster to deploy on kubernetes cluster is failing with error:

Blocks of type "selector" are not expected here. Did you mean to define
argument "selector"? If so, use the equals sign to assign it a value.

Resource configuration is:

resource "kubernetes_service" "service"{
    metadata {
        name="monitoring-influxdb"
        namespace="kube-system"
    }

    spec {
        selector {
            k8s-app="influxdb"
        }

        port{
            port=8086
            target_port=8086
        }
    }
}
4

2 回答 2

3

有同样的问题。注意=和 错误消息If so, use the equals sign to assign it a value.

简单修复:

selector = {
    k8s-app="influxdb"
}

于 2019-07-16T21:54:23.440 回答
2

您的配置文件适用于 Terraform v0.11。更新 Terraform 版本并使用 0.12 版重试后,它返回上述错误。

所以这是 Terraform v0.12 中的一个错误

于 2019-06-24T17:18:32.030 回答