Error: test-configmap failed to create kubernetes rest client for update of resource: Get "http://localhost/api?timeout=32s": dial tcp 127.0.0.1:80: connect: connection refused
It seems like the kubectl provider initialize itself with the non-existing ~/.kube/config and default to localhost instead of recognizing the updated config file.
If I run terraform apply a second time, then it will work:
kubectl_manifest.test-configmap: Creating...
kubectl_manifest.test-configmap: Creation complete after 0s [id=/api/v1/namespaces/default/configmaps/test-configmap]
Hi, I'd like to report an issue when we create a
~/.kube/config
, the provider will not get the latest file.In my case, with Terraform, I am:
kube config
kube config
This will fail:
It seems like the
kubectl provider
initialize itself with the non-existing~/.kube/config
and default tolocalhost
instead of recognizing the updated config file.If I run
terraform apply
a second time, then it will work: