-
-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI healtheck only listening on localhost, not reachable for Kubernetes #592
Comments
@Timmitry thank you for digging into this! And I'm bummed it didn't work out of the box. But we can fix it. I think binding on Would you be up for trying it empirically and reporting back? Otherwise I can try to set up a local kube and give it a try. |
Hey @bensheldon, thanks for answering! I just tested this locally with a Rails project that uses GoodJob. First I started good job with I then opened the Gem with good_job/lib/good_job/probe_server.rb Line 20 in 9b61ea6
to include the thr_handler.run(self, Port: thr_port, Host: "0.0.0.0", Logger: thr_logger, AccessLog: []) Restarting good_job as before, I was now able to
|
A cli health check was introduced in #452 after discussion in #403. The readme describes how to add it to Kubernetes. We did exactly that, but the health check does not work.
We can enter the kubernetes-worker-pod and perform
curl localhost:7001
, which works just fine. However, acurl <ip>:7001
does not work, with aconnection refused
.Unfortunately, Kubernetes will try to ping the pod via its ip, and is therefore not successful, which prevents the containers from starting, as the health checks are never successful.
Do people use this health check with Kubernetes, and if so, how did they solve this problem? 😆
If not, how could we allow the binding on all interfaces? We tracked this down to this code:
good_job/lib/good_job/probe_server.rb
Lines 17 to 24 in 9b61ea6
Where we wildly guessed that providing
BindAddress: "0.0.0.0"
in line 20, which will then be passed on to Webrick here:https://github.com/ruby/webrick/blob/968bc8c4392c0ff8fa8147ca50bc47c74a811886/lib/webrick/server.rb#L111
However, I do not really understand Rack and Webrick, so that is just a first guess, and before experimenting with that (which always involves a deployment...), I first wanted to raise this as an issue here!
Let me know if you need any more information, and best regards 🙂
The text was updated successfully, but these errors were encountered: