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

Issues running in Kubernetes #430

Open
2o1o0 opened this issue Sep 20, 2024 · 5 comments
Open

Issues running in Kubernetes #430

2o1o0 opened this issue Sep 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@2o1o0
Copy link

2o1o0 commented Sep 20, 2024

Describe the bug
Running in Kubernetes is currently an issue as it tries to bind to a port bellow 1024

To Reproduce
Use https://bjw-s.github.io/helm-charts to generate a deployment as I usually do with this kind of projects
Currently using embedded db version to test the app
The app cannot start as it tries to bind it self to port 80
There are a few steps to match K8S hardnening requirements

Expected behavior
I can start the app as a generic K8S app

Additional context
Error :

Overriding address(es) 'http://*:8080'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
System.Net.Sockets.SocketException (13): Permission denied
@michael-j-green
Copy link
Member

Hi @2o1o0, thanks for the report.

I've done all of my testing exclusively in Docker rather than Kubernetes, so I haven't run across this issue.

I'll make a change to bind to a higher port.

@michael-j-green michael-j-green self-assigned this Sep 21, 2024
@michael-j-green michael-j-green added the bug Something isn't working label Sep 21, 2024
@michael-j-green michael-j-green added this to the v1.8.0 milestone Sep 21, 2024
@MotorTruck1221
Copy link

@2o1o0 I haven't played with Kubernetes much,, but from what I know with docker you should be able to change the port. I can try to take a looksee

@michael-j-green
Copy link
Member

I've been setting the port with the docker port mapping: 5198:80. That's what I put in the example docker-compose.yml files.

But you do have a point that I shouldn't bind to port 80 on the app since some people are deploying the app outside of docker, and it will fail to bind.

@2o1o0
Copy link
Author

2o1o0 commented Sep 22, 2024

Hey,

@2o1o0 I haven't played with Kubernetes much,, but from what I know with docker you should be able to change the port. I can try to take a looksee

Kubernetes let you do a lot of things, if not anything, but that doesnt mean you should do it. To achieve that, you'll need to start escalation privileges, which I'm for sure not granting to an app that doesnt actually require it for specific needs (network, CSI/storage).
Matching Kubernetes basic requirements ensure you have a better penetration and larger user base as people will be able to pick it up and us as-is. I have around 20 docker based OSS projects deployed on my local K8S, none of them require changes to make them work.

@michael-j-green thanks for taking a look!

@michael-j-green
Copy link
Member

Listen on any port other than a port less than 1024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants