Occasionally, the kubernetes provider will start dialing localhost instead of the configured kubeconfig context.
Error: Get http://localhost/api/v1/namespaces/prometheus: dial tcp 127.0.0.1:80: connect: connection refused
Error: Get http://localhost/api/v1/namespaces/debug: dial tcp 127.0.0.1:80: connect: connection refused
In the instance of this problem that I ran into, the reason was: multiple terraform threads opening and writing the kubeconfig file without synchronization, which resulted in a messed-up kubeconfig file. This might have been related to the fact that my terraform config included multiple clusters (using this approach)
Workaround
I was able to make this go away by setting: -parallelism=1
This is a re-opening of #546
Occasionally, the kubernetes provider will start dialing localhost instead of the configured kubeconfig context.
In the instance of this problem that I ran into, the reason was: multiple terraform threads opening and writing the kubeconfig file without synchronization, which resulted in a messed-up kubeconfig file. This might have been related to the fact that my terraform config included multiple clusters (using this approach)
Workaround
I was able to make this go away by setting:
-parallelism=1