Skip to content

Connection failure: couldn't connect to host when trying to externally connect to the memgraph kubernetes service #151

@raphael10-collab

Description

@raphael10-collab

As explained and asked in the Memgraph Discord Chat : https://discord.com/channels/842007348272169002/890969266600423504/1390401666989162618

I want to access the memgraph k8s service from outside
I tried with a LoadBalancer and then with NodePort, but didn't succeed:

LoadBalancer:

(base) raphy@raohy:~/.talos/memgraph$ helm upgrade --install memgraph-024 memgraph/
memgraph --set service.type=LoadBalancer

(base) raphy@raohy:~$ kubectl get svc memgraph-024
NAME           TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
memgraph-024   LoadBalancer   aa.aaa.aaa.aa   cc.c.cc.c     7687:31159/TCP   4h50m

Trying to connect to the memgraph-024 service I get "couldn't connect to the host" :

(base) raphy@raohy:~$ mgconsole --host cc.c.cc.c --port 7687 --use-ssl=false
Connection failure: couldn't connect to host: Connection timed out

I then added the actual the control-plane node's IP as External-IP :

(base) raphy@raohy:~/.talos/memgraph$ kubectl patch svc memgraph-024 -p '{"spec":
{"externalIPs":["bbb.bbb.bbb.bbb"]}}
service/memgraph-024 patched

(base) raphy@raohy:~/.talos/memgraph$ kubectl get svc memgraph-024
NAME           TYPE           CLUSTER-IP      EXTERNAL-IP                 PORT(S)              AGE
memgraph-024   LoadBalancer   aa.aaa.aaa.aa   cc.c.cc.c,bbb.bbb.bbb.bbb   7687:31159/TCP   6h14m

I get "couldn't connect to the host" :

(base) raphy@raohy:~$ mgconsole --host cc.c.cc.c --port 7687 --use-ssl=false
Connection failure: couldn't connect to host: Connection timed out

(base) raphy@raohy:~$ mgconsole --host bbb.bbb.bbb.bbb --port 7687 --use-ssl=false
Connection failure: couldn't connect to host: Connection refused

NodePort:

(base) raphy@raohy:~/.talos/memgraph$ helm upgrade --install memgraph-024 memgraph/
memgraph --set service.type=NodePort

(base) raphy@raohy:~/.talos/memgraph$ kubectl get svc memgraph-024
NAME           TYPE       CLUSTER-IP      EXTERNAL-IP       PORT(S)          AGE
memgraph-024   NodePort   aa.aaa.aaa.aa   bbb.bbb.bbb.bbb   7687:31159/TCP   6h25m

I get "couldn't connect to the host" :

(base) raphy@raohy:~/.talos/memgraph$ mgconsole --host bbb.bbb.bbb.bbb --port 7687 --
use-ssl=false
Connection failure: couldn't connect to host: Connection refused


(base) raphy@raohy:~/.talos/memgraph$ mgconsole --host aa.aaa.aaa.aa --port 7687 --use-
ssl=false
Connection failure: couldn't connect to host: Connection timed out

What am I missing and/or doing wrong? How to externally connect to the kubernetes memgraph service?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions