Skip to content

Commit 04d23af

Browse files
committed
Enable optional TLS on nodecache metrics endpoint
Signed-off-by: Nuutti Hakala <[email protected]>
1 parent 7c36dd0 commit 04d23af

File tree

195 files changed

+21250
-951
lines changed

Some content is hidden

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

195 files changed

+21250
-951
lines changed

cmd/node-cache/app/cache_app.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ type ConfigParams struct {
5252
UpstreamSvcName string // Name of the service whose clusterIP is the upstream for node-cache for cluster domain
5353
HealthPort string // port for the healthcheck
5454
SetupIptables bool
55-
SkipTeardown bool // Indicates whether the iptables rules and interface should be torn down
56-
ReloadWithSignal bool // Indicates config reload should be triggered with SIGUSR1, rather than expecting CoreDNS's reload plugin
55+
SkipTeardown bool // Indicates whether the iptables rules and interface should be torn down
56+
ReloadWithSignal bool // Indicates config reload should be triggered with SIGUSR1, rather than expecting CoreDNS's reload plugin
57+
TlsConfig tlsConfig // Config for the metrics endpoint
5758
}
5859

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

0 commit comments

Comments
 (0)