-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 feature flag to enable discovery and use of public IPaddr for clustering. #2719
Add feature flag to enable discovery and use of public IPaddr for clustering. #2719
Conversation
…stering. Before this change, Alertmanager would refuse to startup if using a advertise address binding to any address (0.0.0.0), and the host only had an interface with a public IP address. After this change we feature flag permitting the use of a discovered public address for cluster gossiping. Signed-off-by: Devin Trejo <[email protected]>
Signed-off-by: Devin Trejo <[email protected]>
d414408
to
cbea6e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
cmd/alertmanager/main.go
Outdated
reconnectInterval = kingpin.Flag("cluster.reconnect-interval", "Interval between attempting to reconnect to lost peers.").Default(cluster.DefaultReconnectInterval.String()).Duration() | ||
peerReconnectTimeout = kingpin.Flag("cluster.reconnect-timeout", "Length of time to attempt to reconnect to a lost peer.").Default(cluster.DefaultReconnectTimeout.String()).Duration() | ||
tlsConfigFile = kingpin.Flag("cluster.tls-config", "[EXPERIMENTAL] Path to config yaml file that can enable mutual TLS within the gossip protocol.").Default("").String() | ||
allowInsecureAdvertise = kingpin.Flag("cluster.allow-insecure-public-advertise-address", "[EXPERIMENTAL] Allow alertmanager to discover and listen on a public address.").Bool() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allowInsecureAdvertise = kingpin.Flag("cluster.allow-insecure-public-advertise-address", "[EXPERIMENTAL] Allow alertmanager to discover and listen on a public address.").Bool() | |
allowInsecureAdvertise = kingpin.Flag("cluster.allow-insecure-public-advertise-address-discovery", "[EXPERIMENTAL] Allow alertmanager to discover and listen on a public address.").Bool() |
Maybe we should make it clear in the name of the flag that it is only for discovery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me. Done
Signed-off-by: Devin Trejo <[email protected]>
cluster/advertise.go
Outdated
} | ||
|
||
// discoverAdvertiseAddress will attempt to get a single IP address to use as | ||
// the advertise address when one is not explictly provided. It defualts to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// the advertise address when one is not explictly provided. It defualts to | |
// the advertise address when one is not explicitly provided. It defaults to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Done
cluster/advertise.go
Outdated
if ip == nil { | ||
return nil, errors.Errorf("failed to parse private IP '%s'", privateIP) | ||
if addr == "" { | ||
return nil, errors.New("no public IP found, explicit advertise addr not provided") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil, errors.New("no public IP found, explicit advertise addr not provided") | |
return nil, errors.New("no private/public IP found, explicit advertise addr not provided") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
… message. Signed-off-by: Devin Trejo <[email protected]>
close/reopen to trigger ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks! |
Before this change, Alertmanager would refuse to startup if using a
advertise address binding to any address (0.0.0.0), and the host only
had an interface with a public IP address. After this change we feature
flag permitting the use of a discovered public address for cluster
gossiping.