-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add MesosDnsId field to Marathon App struct #205
Conversation
…rathon group names are reversed and appended to appname. '/a/b/app' becomes app-b-a as a service name
By analyzing the blame information on this pull request, we identified @bluepeppers, @activars and @rasputnik to be potential reviewers |
Looks good - thanks for adding tests. I'm thinking it might be worth documenting this somewhere? Maybe in the readme? |
👍 |
Thanks for taking a look @activars, @bluepeppers . Added some notes to README but was not sure exactly where to put it. Let me know if you'd like more/less information or edits. |
@porcupie thank you. |
Hello,
I added an additional string field
MesosDnsId
to marathon App struct. Marathon AppId Groups are reversed and appended with hyphens to create a DNS friendly name, similar to how Mesos DNS, Consul and some other tools operate.Not sure if this is useful or the most efficient go, but I could not figure out how to do this simple string munging within the haproxy template file itself, so I resorted to adding a field to the Marathon App struct. Perhaps there is a better way but I wanted to draft this Pull Request in case others had a similar need.
Example: Marathon App ID: "/sample/group/appname" becomes "appname-group-sample" in mesos dns so I can refer to this field as
$app.MesosDnsId
inside the haproxy template to write ACL rules likehdr_dom(host) -i {{ $app.MesosDnsId }}
.I will make any other changes needed.
Idea came from a coworker Michael Kuriger.