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
}
}
}
Had this same issue. Note the =
and the error message If so, use the equals sign to assign it a value.
.
Simple fix:
selector = {
k8s-app="influxdb"
}
Your configuration file worked well with Terraform v0.11. Upon updating Terraform version and retrying it with version 0.12, it returned in the above error.
So this is a bug in Terraform v0.12