terraform-aws-eks icon indicating copy to clipboard operation
terraform-aws-eks copied to clipboard

Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable #2

Open angelosnm opened this issue 1 year ago β€’ 4 comments

I'm opening this issue as the previous one https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1234 has been closed with no any proper answer given.

I have an EKS project that was working fine before 2 months. Now, when I try to apply same now I get this issue...

terraform {

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "4.67.0"
    }

    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = "2.20.0"
    }

    helm = {
      version = "2.9.0"
    }
  }
}

provider "kubernetes" {
  host                   = module.eks.cluster_endpoint
  cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
  token                  = module.eks.cluster_token
}

provider "helm" {
  kubernetes {
    host                   = module.eks.cluster_endpoint
    cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)

    exec {
      api_version = "client.authentication.k8s.io/v1beta1"
      args        = ["eks", "get-token", "--cluster-name", module.eks.cluster_name]
      command     = "aws"
    }
  }
}

I also tried token authentication.

angelosnm avatar May 16 '23 15:05 angelosnm

Please provide a full reproduction

bryantbiggs avatar May 16 '23 15:05 bryantbiggs

Please provide a full reproduction

I'm running this on Terraform Cloud with version 1.4.6 (older versions giving the issue too). Also tried other versions of the providers.

angelosnm avatar May 17 '23 07:05 angelosnm

Please provide a full reproduction

I'm running this on Terraform Cloud with version 1.4.6 (older versions giving the issue too). Also tried other versions of the providers.

the AWS keys I use are having full access to everything in AWS

angelosnm avatar May 17 '23 07:05 angelosnm

I don't need access keys or access to your environment (nor should you share that with external parties!) - I just need the configuration you are using

bryantbiggs avatar May 17 '23 13:05 bryantbiggs

closing this issue for now since I am unable to help triage or troubleshoot without a reproduction

bryantbiggs avatar Jun 07 '23 00:06 bryantbiggs

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Jul 07 '23 02:07 github-actions[bot]