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

Optionally fetch Marathon endpoint from ZK #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drewrobb
Copy link

This gives new configuration options to allow fetching marathon endpoints as registered in zookeeper rather than hardcoded endpoints. I've used this patch for some time in our production deploy with marathon 0.11.1.

I have not tested this with https only marathon. We keep http open. I also have not tested this in conjunction with marathon user/password options.

go func() {
for _ = range ticker.C {
ticker := time.NewTicker(1 * time.Second)
go func() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the endpoints may change, I needed to allow this loop to call conf.Marathon.Endpoints() again after all endpoints have had failures. The prior code also would connect to all valid supplied endpoints. It is my understanding that this is not necessary-- with my change only one endpoint is connected at a time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Though I'd be fine with making a larger change to handle errors explicitly (if conf.Marathon.Endpoints() does return nil here, I think it panics?)

if m.UseZookeeper {
endpoints, err := zkEndpoints(m.Zookeeper)
if err != nil {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can't return an error, let's log it. This is a fairly important error case.

@lclarkmichalek
Copy link
Contributor

Thinking about this more, I'd really prefer to have more explicit error handling around the Endpoints method. On the http issue, if we are not going to provide an option to force HTTPS (which is a decent idea tbh), defaulting the http should be fine; if you're an attacker, you can trivially downgrade by just blocking https, if you're not, you can trivially upgrade by redirecting to https (assuming we follow redirects).

@kiambogo
Copy link

Any update on this? I'd love to see this in the latest bamboo Docker image :)

@KidkArolis
Copy link

Cleaning up old PRs, feel free to reopen if still relevant.

@KidkArolis KidkArolis closed this Aug 24, 2016
@j1n6 j1n6 reopened this Sep 1, 2016
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

Successfully merging this pull request may close these issues.

None yet

5 participants