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
29c8b238e5
commit
b4d8c641c6
|
@ -586,10 +586,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
|
||||
|
@ -598,7 +599,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