-
Notifications
You must be signed in to change notification settings - Fork 793
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
Problem accessing gunicorn server from kubernets ingress #136
Comments
@SuperCD Thanks for point it out! We need to update the kubernetes example that works correctly with the Gunicorn deployment. We will hopefully get that fixed very soon. Is this issue something very urgent with you? If it is, we will try our best to get it done sooner. Feel free to ping me on this or any other questions! |
thanks for the fast reply. I've tested it and in fact i was able to make it run if the binding is done on 0.0.0.0 |
Thanks for investigating @SuperCD! I think you found the issue. Which is right now, the docker container right now is only listening localhost. We will address this issue and also improve the experience for deploying with Docker. Those changes should solve the problem you are encountering now. Just some idea in my head right now, I am thinking about using Nginx/gunicorn setup inside the docker container. I will link the PR to this issue, hopefully I can get to it sometime close to next week or so. Feel free to ping me, if you need it before that. I will pump it up and work on it sooner |
hi @SuperCD, I did a little bit more digging on this topic and We think your solution right now is the best one moving forward. We did think about having an Nginx in the docker container as well. However, we realized that right now, most deployment solution probably already have an Nginx component that sits in front of the apps already (kubernetes' ingress controller for example). The Nginx won't bring too much value inside the container. I think it is more fitting that you submit the PR to fix this problem since you provide the solution as well. What do you think? Otherwise, I will merge in the PR 138 that I linked above |
closing this issue now, since we merged in PR138. Feel free to open again, if there is additional issue relate to this. |
Describe the bug
I created a deployment, service and ingress following the example in BentoML/examples/deploy-with-kubernetes/
(by the way the service-with-ingress.yaml contains an error. the service type is ClusterPort but should be ClusterIP)
The problem is that connections to the ingress are refused.
Even when tying to make requests directly to the pod on the 5000 port they get refused.
If I do a kubectl port-forward it works from localhost
I suppose that the problem is with the gunicorn bindings
this is the gunicorn log:
[2019-05-08 14:46:18 +0000] [1] [INFO] Starting gunicorn 19.9.0
[2019-05-08 14:46:18 +0000] [1] [INFO] Listening at: http://127.0.0.1:5000 (1)
and in the BentoML/bentoml/server/gunicorn_server.py file i see this:
def init(self, app, port, workers):
self.options = {'workers': workers, 'bind': '%s:%s' % ('127.0.0.1', port)}
self.application = app
super(GunicornApplication, self).init()
with 127.0.0.1 hardcoded in the code.
But I'm not completely sure that changing it to 0.0.0.0 would solve the problem.
The text was updated successfully, but these errors were encountered: