Skip to content

Enable optional TLS on nodecache metrics endpoint #694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions cmd/node-cache/app/cache_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ type ConfigParams struct {
UpstreamSvcName string // Name of the service whose clusterIP is the upstream for node-cache for cluster domain
HealthPort string // port for the healthcheck
SetupIptables bool
SkipTeardown bool // Indicates whether the iptables rules and interface should be torn down
SkipTeardown bool // Indicates whether the iptables rules and interface should be torn down
TlsConfig tlsConfig // Config for the metrics endpoint
}

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