Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Add flag to define Marathon PORT prefix #1254

Closed
MikeMichel opened this issue Feb 27, 2015 · 9 comments
Closed

Add flag to define Marathon PORT prefix #1254

MikeMichel opened this issue Feb 27, 2015 · 9 comments
Assignees
Milestone

Comments

@MikeMichel
Copy link
Contributor

Marathon overrrides the PORT env inside the container. This can be a nice feature but is also causing trouble if you need to connect to the port the container app did set to PORT.

A flag to set env prefix for the ports marathon sets would solve this.

@sttts
Copy link
Contributor

sttts commented Feb 27, 2015

The question is where to define this? In the AppDefinition or globally (as suggested on the mailing list). To keep Marathon jsons portable between installations, I would vote for the AppDefinition.

@MikeMichel
Copy link
Contributor Author

Maybe a mix makes sense. Set it global with a marathon start parameter but it still can be overwritten in a json app definition.

@kolloch
Copy link
Contributor

kolloch commented Mar 24, 2015

@MikeMichel just to check if I understood it correctly: you are talking about environment variable name clashes, right? So if you have a container which also uses the PORT variable for some other meaning, you currently have a problem. To prevent that, you want to be able to configure a prefix like "MARATHON_" such that all environment variables set by marathon are prefixed with it, e.g. PORT becomes MARATHON_PORT, PORT0 becomes MARATHON_PORT0 etc.

Correct?

@MikeMichel
Copy link
Contributor Author

Hi,

right. Apps like nodejs usually do a process.env.PORT just to name one. One of the last official elasticsearch containers also had this problem. A prefix would prevent this.

@kolloch
Copy link
Contributor

kolloch commented Mar 25, 2015

I guess, we should have prefixed all automatic variables with MARATHON_ from the beginning.

In my opinion, we should definitely enable defining this per AppDefinition since a global setting would potentially invalidate existing app configurations. That would also allow migration of the config on a per app basis.

We can either make the prefix port variable specific or more general.

What would be a good name for a general prefix attribute of the app definition? "automaticEnvVarsPrefix" is maybe a bit verbose. "envAutoVarsPrefix"?

I guess the setting should not effect

  • MESOS_TASK_ID
  • MARATHON_APP_ID
  • MARATHON_APP_VERSION

since they are already prefixed.

All ports related variables should be prefixed.

We also set HOST. Should we also prefix that?

I would like to hear the opinion of @drexin and @ConnorDoyle about that as well.

@MikeMichel
Copy link
Contributor Author

@kolloch is there a time frame to get this done?

@kolloch kolloch added this to the 0.10.0 milestone May 18, 2015
@MikeMichel
Copy link
Contributor Author

@kolloch 0.10.0 seems to be far away. could you give me a hint where to disable this override in the source code?

@kolloch
Copy link
Contributor

kolloch commented May 20, 2015

Hi @MikeMichel ,

unfortunately, you are absolutely right because many things in 0.10.0 will actually be shifted to even later releases.

The code is in TaskBuilder.scala. Search for PORT.

Does it help you to make this a global setting (since that's easier to do)? That might make migrations difficult, though.

@MikeMichel
Copy link
Contributor Author

yes, a global setting would be absolutely fine.

@kolloch kolloch added the ready label Jul 9, 2015
@gkleiman gkleiman self-assigned this Jul 10, 2015
kolloch pushed a commit that referenced this issue Jul 15, 2015
Fixes #1254 - Add flag to define Marathon PORT prefix.
@d2iq-archive d2iq-archive locked and limited conversation to collaborators Mar 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants