Kubernetes - Resolve "Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable"

by
Jeremy Canfield |
Updated: November 06 2023
| Kubernetes articles
Let's say something like this is being returned.
Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
I got this when attempting to Create an Elastic File System (EFS) with a CDI Driver using Terraform.
You can try setting the KUBE_CONFIG variable to point to your kube config file.
export KUBE_CONFIG_PATH=/path/to/kube/config
Or, if using Terraform, your kubernetes provider.tf file could include config_path with the path to your kube config file.
provider "kubernetes" {
config_path = "/path/to/kube/config"
}
Or, you may need to include the helm provider.
provider "helm" {
kubernetes {
config_path = "/path/to/kube/config"
}
}
Did you find this article helpful?
If so, consider buying me a coffee over at