IBM Cloud Docs
How can I resolve the network error when working with the Kubernetes Service provider?

How can I resolve the network error when working with the Kubernetes Service provider?

During the cluster upgrade from Kubernetes Service older version to new version. The Terraform apply fails with the TCP connection error message.

Error: Get "http://localhost/api/v1/": dial tcp [::1]:80: connect: connection refused

Or

Error: Kubernetes service cluster unreachable: invalid configuration: no configuration has been provided

You are combining the cluster provisioning and working with the Kubernetes Service provider at the same time in your Terraform template in the IBM Cloud Schematics workspace or in your localhost. You make a change in the cluster configuration that leads to the cluster re-create. When you run terraform refresh command, you view strange errors such as, network or namespace issues.

To troubleshoot this error you need to ensure:

  • You don't combine the Kubernetes Service provider with the cluster resource at the same time in the Terraform template.

  • The resources should not be created in the same Terraform template or module where Kubernetes Service provider resources are in use.

  • The Terraform provider evaluates the provider blocks versus actual resource, and the order in which the resources are defined. For more information, see Provider configuration.

If you cannot resolve this issue, contact support by opening a support case for the service that you want to work with. Make sure to include the incident ID. For more information, see Using the Support Center.