Skip to content

Commit 01216ff

Browse files
committed
Enable optional TLS on nodecache metrics endpoint
Signed-off-by: Nuutti Hakala <[email protected]>
1 parent 9aa70b8 commit 01216ff

Some content is hidden

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

96 files changed

+11550
-35
lines changed

cmd/node-cache/app/cache_app.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ 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
55-
ReloadWithSignal bool // Indicates config reload should be triggered with SIGUSR1, rather than expecting CoreDNS's reload plugin
54+
SkipTeardown bool // Indicates whether the iptables rules and interface should be torn down
55+
ReloadWithSignal bool // Indicates config reload should be triggered with SIGUSR1, rather than expecting CoreDNS's reload plugin
56+
TlsConfig tlsConfig // Config for the metrics endpoint
5657
}
5758

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

0 commit comments

Comments
 (0)