Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative to load_config_file = false? #1162

Closed
KirstenCodesNZ opened this issue Feb 10, 2021 · 5 comments
Closed

Alternative to load_config_file = false? #1162

KirstenCodesNZ opened this issue Feb 10, 2021 · 5 comments
Labels

Comments

@KirstenCodesNZ
Copy link

KirstenCodesNZ commented Feb 10, 2021

Terraform version, Kubernetes provider version and Kubernetes version

Terraform version: v0.13.5
Kubernetes Provider version: v2.0.2
Kubernetes version: v1.19.3

Terraform configuration

provider "kubernetes" {
	version                = "~> 2.0"
	host                   = var.ClusterEndpoint
	cluster_ca_certificate = try(base64decode(var.ClusterCertData), "")
	token                  = data.aws_eks_cluster_auth.cluster.token
	load_config_file       = false
}

Error

Error: Kubernetes cluster unreachable: stat /home/cra/.kube/config: no such file or directory

Question

Before upgrading the Kubernetes provider to v2.0.2, we used v1.13.3. In the earlier version we used load_config_file = false because we provide the credentials directly, as shown above, and don't want it to try load a non-existent file. But in the later version this is deprecated.
How do we replicate the behaviour now, and can that please be added to the documentation because there is little information on this?

@KirstenCodesNZ
Copy link
Author

In this documentation it explains why it's been removed and by removing the load_config_file attribute the expected result is what we want but this isn't working.
I do not have KUBE_CONFIG_PATH, or config_path set.

@aareet
Copy link
Contributor

aareet commented Feb 10, 2021

Hi, recently @dak1n1 contributed some examples of how to work with each major cloud with examples - I think that the EKS example from that list may help you - #1115. Let us know if those aren't sufficient.

@dak1n1
Copy link
Contributor

dak1n1 commented Feb 10, 2021

I've also got a change in the works that will basically give us the same functionality as load_config_file = false. The goal is to create a more intuitive workflow by throwing an error when two mutually-exclusive configuration options are used (for example, if you've added a provider {} block containing a token, it will use that token instead of pulling the configuration options from an environment variable that you might not even know is set). #1141

@KirstenCodesNZ
Copy link
Author

I have fixed the issue. The problem was that the Helm provider also had to be upgraded to "~> 2.0".

@ghost
Copy link

ghost commented Mar 14, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants