Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmd/kured/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
drainTimeout time.Duration
rebootDelay time.Duration
period time.Duration
metricsHost string
metricsPort int
drainGracePeriod int
drainPodSelector string
Expand Down Expand Up @@ -126,6 +127,8 @@ func NewRootCommand() *cobra.Command {
"node name kured runs on, should be passed down from spec.nodeName via KURED_NODE_ID environment variable")
rootCmd.PersistentFlags().BoolVar(&forceReboot, "force-reboot", false,
"force a reboot even if the drain fails or times out")
rootCmd.PersistentFlags().StringVar(&metricsHost, "metrics-host", "",
"host where metrics will listen")
rootCmd.PersistentFlags().IntVar(&metricsPort, "metrics-port", 8080,
"port number where metrics will listen")
rootCmd.PersistentFlags().IntVar(&drainGracePeriod, "drain-grace-period", -1,
Expand Down Expand Up @@ -844,5 +847,5 @@ func root(cmd *cobra.Command, args []string) {
go maintainRebootRequiredMetric(nodeID, hostSentinelCommand)

http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", metricsPort), nil))
log.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", metricsHost, metricsPort), nil))
}
2 changes: 2 additions & 0 deletions kured-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ spec:
# - --annotate-nodes=false
# - --lock-release-delay=30m
# - --log-format=text
# - --metrics-host=""
# - --metrics-port=8080