Skip to content

Commit 93f5941

Browse files
committed
Enable optional TLS on nodecache metrics endpoint
Signed-off-by: Nuutti Hakala <[email protected]>
1 parent 5c70f6c commit 93f5941

File tree

303 files changed

+41304
-11483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+41304
-11483
lines changed

cmd/node-cache/app/cache_app.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ type ConfigParams struct {
5151
UpstreamSvcName string // Name of the service whose clusterIP is the upstream for node-cache for cluster domain
5252
HealthPort string // port for the healthcheck
5353
SetupIptables bool
54-
SkipTeardown bool // Indicates whether the iptables rules and interface should be torn down
54+
SkipTeardown bool // Indicates whether the iptables rules and interface should be torn down
55+
TlsConfig tlsConfig // Config for the metrics endpoint
5556
}
5657

5758
type iptablesRule struct {
@@ -83,7 +84,10 @@ func (c *CacheApp) Init() {
8384
if c.params.SetupIptables {
8485
c.initIptables()
8586
}
86-
initMetrics(c.params.MetricsListenAddress)
87+
met := New(c.params.MetricsListenAddress, &c.params.TlsConfig)
88+
if err := met.OnStartup(); err != nil {
89+
clog.Infof("Failed to serve metrics with error \"%s\"", err)
90+
}
8791
// Write the config file from template.
8892
// this is required in case there is no or erroneous kube-dns configpath specified.
8993
c.updateCorefile(&config.Config{})

0 commit comments

Comments
 (0)