<p>I am started GKE cluster using Terraform (<a href="https://learn.hashicorp.com/terraform/kubernetes/provision-gke-cluster" rel="nofollow noreferrer">link</a>), Now I am trying to release the helm charts on the cluster, and tried for "Nginx Ingress" helm chart which is as follow:</p>

<pre><code>resource "helm_release" "ingress" {
  name       = "ingress"
  repository = "https://kubernetes.github.io/ingress-nginx"
  chart      = "ingress-nginx"
}
</code></pre>

<p>Terraform Plan:</p>

<pre><code>Terraform will perform the following actions:

  # helm_release.ingress will be created
  + resource "helm_release" "ingress" {
      + chart            = "ingress-nginx"
      + disable_webhooks = false
      + force_update     = false
      + id               = (known after apply)
      + metadata         = (known after apply)
      + name             = "ingress"
      + namespace        = "default"
      + recreate_pods    = false
      + repository       = "https://kubernetes.github.io/ingress-nginx"
      + reuse            = false
      + reuse_values     = false
      + status           = "DEPLOYED"
      + timeout          = 300
      + verify           = false
      + version          = "2.3.0"
      + wait             = true
    }
</code></pre>

<p>But I am getting an error</p>

<pre><code>Error: Kubernetes cluster unreachable: Get https://35.232.164.12/version?timeout=32s: dial tcp 35.232.164.12:443: i/o timeout

  on helm.tf line 36, in resource "helm_release" "ingress":
  36: resource "helm_release" "ingress" {
</code></pre>

<p>Here terraform not able to create a connection with Kubernetes cluster. cluster is unreachable.</p>

<p>Also using terraform also have to first setup tiller then and then helm chart will work.</p>

<p>in terraform, you can use <code>helm</code> provider, if are using service account you add existing one or create one if required</p>

<pre><code>provider "helm" {
  service_account = "${kubernetes_service_account.helm_account.metadata.0.name}"
  tiller_image = "gcr.io/kubernetes-helm/tiller:${var.helm_version}"
  #install_tiller = false

  kubernetes {
    host                   = "${google_container_cluster.&lt;name&gt;.endpoint}"
    token                  = "${data.google_client_config.current.access_token}"

    client_certificate     = "${base64decode(google_container_cluster.data-dome-cluster.master_auth.0.client_certificate)}"
    client_key             = "${base64decode(google_container_cluster.data-dome-cluster.master_auth.0.client_key)}"
    cluster_ca_certificate = "${base64decode(google_container_cluster.data-dome-cluster.master_auth.0.cluster_ca_certificate)}"
  }
</code></pre>

<p>one <code>helm</code> started running you can start setting up other releases using helm package manager.</p>

<p>you can also check this answer for more details : <a href="https://stackoverflow.com/questions/55676673/deploying-helm-workloads-with-terraform-on-gke-cluster">Deploying Helm workloads with Terraform on GKE cluster</a></p>
