hashicorp / learn-terraform-provision-eks-cluster

https://developer.hashicorp.com/terraform/tutorials/kubernetes/eks
Mozilla Public License 2.0
397 stars 1.2k forks source link

kubeconfig is not available #72

Closed balaji-source closed 1 year ago

balaji-source commented 2 years ago

kubeconfig is not available in the outputs.tf file

BrianMMcClain commented 1 year ago

Hi @balaji-source! Can you provide more information on any errors you are receiving? Just for reference, the kubeconfig won't be stored as an output directly, instead it's fetched from AWS by the aws CLI

In the same directory as your Terraform configuration, if you run the following command:

aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)

You should see something similar to the following output:

Added new context arn:aws:eks:us-east-2:id:cluster/cluster-name to /Users/myusername/.kube/config

This should also automatically set the current kubectl context to the new EKS cluster

$ kubectl config current-context
arn:aws:eks:us-east-2:id:cluster/cluster-name

One final thing I'll note is that the tutorial and the EKS module have both been recently updated. If you'd like to give it another go and provide the output of the aws eks command, I'd be more than happy to help debug the issue :) Thanks!

BrianMMcClain commented 1 year ago

Closing for now, but if you're still seeing this issue, please feel free to reopen! Thanks! 😄