Skip to content
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

Expose port on host machine problem #4498

Open
another-tee opened this issue Apr 17, 2024 · 1 comment
Open

Expose port on host machine problem #4498

another-tee opened this issue Apr 17, 2024 · 1 comment

Comments

@another-tee
Copy link

I'm trying to create an API for model inference using Flask and Gunicorn. However, when I attempt to access it via localhost:31111, the connection is refused.

In my app.py, I've set up a health check endpoint at "/" to ensure the application is running correctly. Here's a snippet of the code:
image

This Flask application is configured to run on port 5000 inside the container, as specified in my Dockerfile and Kubernetes deployment configuration. Additionally, I'm using Gunicorn to serve the application within the container. Here's how I'm running it in my Dockerfile:
image
image

Now, for Kubernetes deployment and service configuration, I have the following YAML files:
image
image

I've tested the API inside the pod, and it works fine. However, when I try to access it from the host machine, the connection is refused.
Could you please guide me on resolving this issue?

@War-Oxi
Copy link

War-Oxi commented May 9, 2024

What is the operating system or execution environment of the host machine?

Have you checked the firewall?

Please check if port 31111 on the host machine is open using tools such as Telnet, netstat, or the ss command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants