<p>From the time I have upgraded the versions of my eks terraform script. I keep getting error after error.</p>

<p>currently I am stuck on this error:</p>

<blockquote>
  <p>Error: Get <a href="http://localhost/api/v1/namespaces/kube-system/serviceaccounts/tiller" rel="nofollow noreferrer">http://localhost/api/v1/namespaces/kube-system/serviceaccounts/tiller</a>: dial tcp 127.0.0.1:80: connect: connection refused</p>
  
  <p>Error: Get <a href="http://localhost/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/tiller" rel="nofollow noreferrer">http://localhost/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/tiller</a>: dial tcp 127.0.0.1:80: connect: connection refused</p>
</blockquote>

<p>The script is working fine and I can still use this with old version but I am trying to upgrade the cluster version .</p>

<p><strong>provider.tf</strong></p>

<pre><code>provider "aws" {
  region  = "${var.region}"
  version = "~&gt; 2.0"

  assume_role {
    role_arn = "arn:aws:iam::${var.target_account_id}:role/terraform"
  }
}

provider "kubernetes" {
  config_path = ".kube_config.yaml"
  version = "~&gt; 1.9"
}

provider "helm" {
  service_account = "${kubernetes_service_account.tiller.metadata.0.name}"
  namespace       = "${kubernetes_service_account.tiller.metadata.0.namespace}"


  kubernetes {
    config_path = ".kube_config.yaml"
  }
}

terraform {
  backend "s3" {

  }
}

data "terraform_remote_state" "state" {
  backend = "s3"
  config = {
    bucket         = "${var.backend_config_bucket}"
    region         = "${var.backend_config_bucket_region}"
    key            = "${var.name}/${var.backend_config_tfstate_file_key}" # var.name == CLIENT
    role_arn       = "${var.backend_config_role_arn}"
    skip_region_validation = true
    dynamodb_table = "terraform_locks"
    encrypt        = "true"
  }
}
</code></pre>

<p><strong>kubernetes.tf</strong></p>

<pre><code>resource "kubernetes_service_account" "tiller" {
  #depends_on = ["module.eks"]

  metadata {
    name      = "tiller"
    namespace = "kube-system"
  }

  automount_service_account_token = "true"
}

resource "kubernetes_cluster_role_binding" "tiller" {
  depends_on = ["module.eks"]

  metadata {
    name = "tiller"
  }

  role_ref {
    api_group = "rbac.authorization.k8s.io"
    kind      = "ClusterRole"
    name      = "cluster-admin"
  }

  subject {
    kind = "ServiceAccount"
    name = "tiller"

    api_group = ""
    namespace = "kube-system"
  }
}
</code></pre>

<p>terraform version: 0.12.12
eks module version: 6.0.2</p>

gamechanger17
<p>It means your <code>server:</code> entry in your <code>.kube_config.yml</code> is pointing to the wrong port (and perhaps even the wrong protocol, as normal kubernetes communication travels over <code>https</code> and is secured via mutual TLS authentication), or there is no longer a proxy that <em>was</em> listening on <code>localhost:80</code>, or perhaps the <a href="https://kubernetes.io/docs/reference/access-authn-authz/controlling-access/#api-server-ports-and-ips" rel="nofollow noreferrer"><code>--insecure-port</code></a> used to be <code>80</code> and is now <code>0</code> (as is strongly recommended)</p>

<p>Regrettably, without more specifics, no one can <strong>guess</strong> what the correct value was or should be changed to</p>
