0

Running docker-compose up on a simple web app works as expected. Running kompose up on the same app while attempting to connect to a Google Cloud cluster doesn't work:

...
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. 

FATA Error while deploying application: Get http://127.0.0.1:6443/api: dial tcp 127.0.0.1:6443: connect: connection refused

What are possible causes of this problem?

Other posts here on SO do not help, and I can't find any other relevant result on the web.

Giorgio
  • 2,137
  • 3
  • 20
  • 40
  • what are you trying to reach on the localhost exactly? – suren May 24 '20 at 10:11
  • Actually I'm quite new to Kubernetes, and I guess I would just like to reach my newly created cluster on Google Cloud. What is this `127.0.0.1:6443/api` endpoint? – Giorgio May 24 '20 at 15:03
  • Probably that's the default endpoint. You want to reach a GKE cluster, or you built one? – suren May 24 '20 at 17:53
  • I built a GKE cluster (following this tutorial: https://cloud.google.com/kubernetes-engine/docs/quickstart). – Giorgio May 25 '20 at 07:10
  • then your endpoint is the master's external IP. If you click on the cluster, you should see the IP address, from the console. But I don't know how to configure kompose. have never used it. – suren May 25 '20 at 07:21
  • Thank you. Are you then suggesting that my Kubernetes is not pointing to my cluster? If so, it would already be useful if you could suggest how to troubleshoot this directly with `kubectl`. (I am just using Kompose because it's supposed to be easier, but I'm also glad to fix my issue with `kubectl` directly.) – Giorgio May 25 '20 at 07:38
  • 1
    `kubectl` is the kubernetes client. First, you need to deploy all your stuff on kubernetes. Yes, my guess is that your kompose is converting the files and is trying to deploy to kubernetes; thinking that the `api-server` is running on the same machine, which is not the case, because you are on GKE. – suren May 25 '20 at 09:25
  • I am not sure whether the difference in the apiversions is causing this issue. I found [this similar discussion thread](https://stackoverflow.com/questions/59690266/not-able-to-deploy-to-kubernetes-cluster-using-kompose), where the issue is resolved by replacing the apiversions. – Digil May 25 '20 at 18:49
  • Thank you @Digil. I just checked, and apparently Kompose already took care of putting `v1` or `apps/v1` in the generated files. But I'll post an update if I find something else. – Giorgio May 25 '20 at 19:23

0 Answers0