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

Support exposed port as environment variable #4

Closed
matthew-gill opened this issue Mar 16, 2020 · 4 comments
Closed

Support exposed port as environment variable #4

matthew-gill opened this issue Mar 16, 2020 · 4 comments

Comments

@matthew-gill
Copy link
Contributor

Hey!
Thanks for this project, very useful - I'll be moving over from Kopf soon.

I'm currently setting up preview environment for my PRs, where each environment has it's own copy of elasticsearch etc. I'm currently getting some port clashes with the other services within my stack.

I see on the Cerebro config you can specify something like http.port=1234 to change the exposed port.

I'm wondering if it would be possible to update the Dockerfile to allow us to set the port as an environment variable? I can have a go raising a PR some point soon, just wondered if anything was in the works?

@moliware
Copy link
Collaborator

Hi!

I'm not sure if I understood, if you have port clashes in your docker host you can run something like:

docker run -p 9005:9000 lmenezes/cerebro

So that you can access cerebro in http://your_docker_host:9005

If you want to run and expose the incoming port different than 9000, I guess you can do it in the docker run command https://docs.docker.com/engine/reference/run/#expose-incoming-ports.

@matthew-gill
Copy link
Contributor Author

thanks for the reply @moliware I know it's possible when running docker like this, however, within a kubernetes cluster you cannot map ports like this unfortunately.

All containers within a pod must only ever use distinct ports, and k8s doesn't support port mappings.

@matthew-gill
Copy link
Contributor Author

Thanks for the prompt @moliware , I raised a PR here

@moliware
Copy link
Collaborator

PR merged! Thank you!

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