-
Notifications
You must be signed in to change notification settings - Fork 986
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
terraform refresh attempts to dial localhost #546
Comments
👍 |
I'm having a similar issue when trying to
|
After dealing with this error on multiple occasions over time, I've come to understand it better. At its core this is a dependency issue. When the cluster does not exist terraform cannot understand how to handle this namespace resource which it cannot refresh. Despite adding a depends_on to the kubernetes_namespace resource I still get this error from time to time when applying changes, especially when those changed mean my cluster must be destroyed. As I understand it from the documentation dependencies only refer to the application order, and do not take into consideration whether a depended on resource exists. For those still dealing with this, the workaround I generally apply looks something like this:
Sorry I don't have better information on exactly when this happens vs when it just works. |
This seems like the upstream progressive apply issue: hashicorp/terraform#4149 You cannot currently (reliably) chain together a provider's config with the output of a resource. |
I'm also getting this issue when trying to import a kubernetes_namespace and I even have that happen after hardcoding the host, token and cluster_ca_certificate values in the kubernetes provider. Is this really related to hashicorp/terraform#4149
|
@slancio Did you make any progress with this? I am getting the same issue trying to upgrade to v8.0.0 of the eks module |
@paulalex None at all. We're working around the problem by not importing resources and deleting and recreating via terraform if we have to. |
@slancio I think mine might be unrelated as if I set Thanks for coming back to me. |
I'd tried setting KUBECONFIG without any luck but I didn't try the load_config_file flag. Will give that a go. |
I am having this issue when running terraform from state, I have no kubeconfig on disk. |
@hazcod I am not really an expert on this but I was seeing this error when there was no kubeconfig passed to the provider and nothing in ~/.kube, but I dont know if this is related to your issue. I had numerous issues and so I load the kubeconfig by setting |
I’m afraid the kubeconfig is passed solely as a Terraform variable, it does not touch disk |
To add: I also tried with |
I didnt try this but what worked for me was setting |
So the kubeconfig is already present in the state file and does not exist on disk separately, so not sure if that's applicable? |
@hazcod did you end up working around this with kubeconfig ? looking at your GH actions seems like you are now able to plan. Wondering if you did anything special to make it work ? |
I ended up moving away from the kubernetes terraform provider.. |
@hazcod ok that sucks. thanks for coming back to me |
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! |
This issue was originally opened by @swtch1 as hashicorp/terraform#22024. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
../modules/gke_cluster
main.tf
Debug Output
terraform refresh trace
Expected Behavior
I expected Terraform to refresh the state.
Actual Behavior
Steps to Reproduce
Additional Context
The two resources in the error (/namespaces/prometheus and /namespaces/debug/) are namespaces for my Kubernetes cluster.
The text was updated successfully, but these errors were encountered: