Replaces flag --metrics-port with --metrics-addresss

Signed-off-by: Nathan Kinkade <kinkade@measurementlab.net>
This commit is contained in:
Nathan Kinkade
2023-08-03 14:46:36 -06:00
parent 16dc5e30d9
commit 528c7bb14b
2 changed files with 5 additions and 4 deletions
+4 -4
View File
@@ -47,7 +47,7 @@ var (
drainTimeout time.Duration
rebootDelay time.Duration
period time.Duration
metricsPort int
metricsAddress string
drainGracePeriod int
drainPodSelector string
skipWaitForDeleteTimeoutSeconds int
@@ -126,8 +126,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().IntVar(&metricsPort, "metrics-port", 8080,
"port number where metrics will listen")
rootCmd.PersistentFlags().StringVar(&metricsAddress, "metrics-address", ":8080",
"address where metrics will listen")
rootCmd.PersistentFlags().IntVar(&drainGracePeriod, "drain-grace-period", -1,
"time in seconds given to each pod to terminate gracefully, if negative, the default value specified in the pod will be used")
rootCmd.PersistentFlags().StringVar(&drainPodSelector, "drain-pod-selector", "",
@@ -844,5 +844,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(metricsAddress, nil))
}
+1
View File
@@ -83,3 +83,4 @@ spec:
# - --annotate-nodes=false
# - --lock-release-delay=30m
# - --log-format=text
# - --metricsAddress=:8080