Comments (6)
The random port Marathon allocates is actually for use by HAProxy...it's a little hard to understand at first. Basically, there is a "Marathon port" and a "Mesos port". Deimos understands and works with the Mesos port. Deimos never sees the "Marathon port", which you are supposed to bridge to with HAProxy.
We're not really what to do with this one going forward. Note that the environment variables PORT0
(PORT1
, &c) contain the Mesos ports, not the Marathon ports.
from deimos.
I did a small hack to deimos/docker.py to read out the --exposed option and use that for the inner port in deimos.py run().
Replace line 22 with this: https://gist.github.com/alexandernilsson/1e4ea85099196b2787ec
It obviously only works with a single port. Submitting it as a gist instead of PR because I honestly don't like the approach myself.
from deimos.
What does the Marathon task look like that uses the --expose
option?
from deimos.
@MikeMichel It would be great to see an example of a container spec and a Marathon request, as well as the desired port mappings.
-
If you can, the Dockerfile or the result of
sudo docker inspect --format \ '{{.ContainerConfig.PortSpecs}}{{"\n"}}{{.ContainerConfig.ExposedPorts}}' \ <image-name>
would be great information to have.
-
The Marathon JSON would be helpful, too.
from deimos.
Seems i need to dive more into the marathon/mesos port thing but in the end i got what i needed by using app.listen(process.env.PORT)
in the nodejs app i tried to deploy and let marathon do all the portmapping. Now i have working links to the app in the task tab of the marathon webgui and the produced haproxy output works too
listen fibu_15471
bind 127.0.0.1:15471
mode http
option tcplog
option httpchk GET /
balance leastconn
server fibu-3 MesosSlave01.fritz.box:31076 check
server fibu-2 MesosSlave02:31564 check
server fibu-1 MesosSlave01.fritz.box:31175 check
Right now i have no access to the environment for further testing. will continue in 2 weeks when im back from vacation.
Mike
from deimos.
It sounds like @solidsnack was able to help you solve this issue, so I'm going to close it. Feel free to comment again and reopen if you still have questions, @MikeMichel.
from deimos.
Related Issues (20)
- deimos not picking up additional options for the run command from config HOT 1
- TypeError exception during launch HOT 3
- Possible to run any docker container? HOT 3
- Status code not being returned by conteinerizer
- Not sure how to login to private registry HOT 15
- Support Images with Entrypoint defined HOT 17
- Error when trying to start mesos-slave with bad path for containerizer_path HOT 1
- Mesos with Spark trying to download non-existent libmesos/ubuntu:14.04 HOT 21
- Use Deimos for only Marathon HOT 2
- Container info in /cgroups on CentOS 6.5 HOT 4
- -p option doesn't work as documented HOT 1
- Mesos environment variables not set when task_info specified
- More than just docker? HOT 3
- Hooks to run tasks after container launch / shutdown HOT 5
- Container flaps between 'Staging' and 'Running' => can't download a package HOT 4
- Question: How does port pairing work? HOT 1
- Deimos should not override workdir HOT 1
- Customize docker run arguments HOT 2
- Deimos insists on ate least one pull per image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deimos.