mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Add exposed metrics listener instead of replacing loopback listener
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
a8a6edfb0d
commit
37caf87d6d
@ -523,10 +523,11 @@ func (e *ETCD) clientURL() string {
|
||||
|
||||
// metricsURL returns the metrics access address
|
||||
func (e *ETCD) metricsURL(expose bool) string {
|
||||
address := "http://127.0.0.1:2381"
|
||||
if expose {
|
||||
return fmt.Sprintf("http://%s:2381", e.address)
|
||||
address = fmt.Sprintf("http://%s:2381,%s", e.address, address)
|
||||
}
|
||||
return "http://127.0.0.1:2381"
|
||||
return address
|
||||
}
|
||||
|
||||
// cluster returns ETCDConfig for a cluster
|
||||
@ -535,7 +536,7 @@ func (e *ETCD) cluster(ctx context.Context, forceNew bool, options executor.Init
|
||||
Name: e.name,
|
||||
InitialOptions: options,
|
||||
ForceNewCluster: forceNew,
|
||||
ListenClientURLs: fmt.Sprintf(e.clientURL() + ",https://127.0.0.1:2379"),
|
||||
ListenClientURLs: e.clientURL() + ",https://127.0.0.1:2379",
|
||||
ListenMetricsURLs: e.metricsURL(e.config.EtcdExposeMetrics),
|
||||
ListenPeerURLs: e.peerURL(),
|
||||
AdvertiseClientURLs: e.clientURL(),
|
||||
|
Loading…
Reference in New Issue
Block a user