Can't connect to Neo4J server on Hetzner Cloud Kubernetes cluster, while same setup works on Azure AKS #261
Replies: 5 comments 1 reply
-
One little update/success I noticed that the nginx-ingress-controller External IP onAzure was actually showing the IPv4 address from the load balancer, while on Hetzner it was showing the dns name Still I get the two errors from the browser
|
Beta Was this translation helpful? Give feedback.
-
Hi @vinnytwice , unfortunately I am not familiar with Neo4J so I hope that others reading this might be able to help. I am going to convert this issue to a discussion since it's related to an application and not a problem with my tool :) |
Beta Was this translation helpful? Give feedback.
-
Hi @vitobotta thank you so much for the tool and answering this quick. I was hoping for someone to spot some misconfiguration for either the ingress-nginx Helm chart, which sets the Hetzner load balancer, or the config for the Hetzner-k3s tool. The only difference from the Azure and the Hetzner cluster is the cloud provider itself, so Neo4j configuration should not causing the issue as in fact the Neo4j driver in Node.js pod connects as expected after removing the load balancer hostname annotation in the ingress. I really think it has to do with the load balancer configuration. Many thanks again. Vincenzo |
Beta Was this translation helpful? Give feedback.
-
@vitobotta Hi again Vito, I reached the Neo4j team and they think that my issue might have to do with the Hetzner networking or load balancers, as pointed out by the Neo4j team, so my implementation to expose the 2 tcp ports to the neo4j default service (as stated below) doesn't work on Hetzner.
Now, the solution I ended up using is the preferred Neo4j way which is to use a dedicated LoadBalancer service just for it and using annotations as I do in the ingress-nginx chart values I create another Hetzner load balancer, dough it means creating a second tls certificate issuance for it and of course a little more expensive solution..
They are working to make it work seamlessly when Neo4j is behind an Ingress, one of which is using something like Haproxy for which they are creating an Helm Chart, but for now they are just evaluating various methods. Nothing definitive yet.. One thing dough..I can't find a complete list of params to set for the hetzner-k3s config file.. like assign a load balancer only to a certain worker.. Thank you very much again. |
Beta Was this translation helpful? Give feedback.
-
Glad you are making progress 👍 |
Beta Was this translation helpful? Give feedback.
-
I'm creating a Kubernetes cluster on Hetzner Cloud with the same configuration I use on Azure AKS but I'm facing connection problems with Neo4j.
On Hetzner cluster while I can access Neo4J browser from the path I defined in my Ingress, I can't connect to the Neo4j server using the bolt+s connection server.mydomain.com:7687 URL, nor does the Neo4j driver in my Node.js server.This is not the case with the AKS cluster.
From Neo4j browser debbug connection I see that the Handshake fails:
From Chrome console I see 2 errors:
The one difference between the two clusters is the ingress controller's Load Balancer configuration for which on Hetzner I set annotations in the ingress-nginx Helm chart as so:
AFAIK
ingress-nginx
controller (which I'm using) handles WebSockets automatically unlikenginx-ingress
for which should be mapped to a service using an annotation likenginx.ingress.kubernetes.io/websocket-services: neo4j
, I tried using the annotation anyways but didn't make a difference.The complete procedure I used for the Hetzner cluster is:
I created a Kubernetes a single node cluster on Hetzner Cloud using k3s v1.27.4+k3s1, installed ingress-nginx v4.7.1 exposing TCP ports 7474 and 7687 to Neo4j service as you can see above (the Load Balancer TCP ports are exposed and healthy) and Cert-manager v1.12.3 Helm charts.
In my domain DNS manager I created an A record pointing to the load balancer IPv4 with host set as
sever
to use it in myCertificate
andIngress
manifests asserver.mydomain.com
. Thetls-secret
gets created correctly.To install Neo4j chart I'm setting these values for Neo4j configuration:
I tried setting the
dbms.connector.bolt.advertised_address
(dough on Azure is not set) using both the any IP0.0.0.0:7687
value and the specific dnsserver.mydomain.com:7687
value but that didn't make a difference either.On the Hetzner Firewall rules I created rules for ports 80(http) and 443 (https) to allow to port 7474 and 7687. I also tried disabling the Firewall as a test but still can't reach Neo4j server.
this is the cluster_config.yaml I'm using to create the cluster:
Thinking that it might had to do with the Load balancer targeting also the control plane I excluded it but it didn't make any difference.
Can you spot some other configuration I need to add or change for this setup?
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions