Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connectex: Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connectex: kubernetes kubernetes

Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connectex:


Kompose always refer to http://localhost:8080/ by default. The problem is that as you are using minikube, your api server is in a different address.

To check the address of your API, run any kubectl command and get your API server address:

$ kubectl get nodes -v6

Output:

I0518 07:27:05.109476    3656 loader.go:375] Config loaded from file:  /home/christofoletti/.kube/configI0518 07:27:05.138651    3656 round_trippers.go:443] GET https://192.168.39.6:8443/api/v1/nodes?limit=500 200 OK in 19 millisecondsNAME       STATUS   ROLES    AGE     VERSIONcluster2   Ready    master   3d19h   v1.18.2

As you can see, we have GET https://192.168.39.36:8443/api/v1/nodes?limit=500 200 OK.

So, my API server address is https://192.168.39.26:8443/.

Now you can run $ kompose up --server https://192.168.39.26:8443/ and Kompose will know where to send the request.