From 528c7bb14b983a63274a54f0868a5dd06c53ec7f Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Thu, 3 Aug 2023 14:46:36 -0600 Subject: [PATCH] Replaces flag --metrics-port with --metrics-addresss Signed-off-by: Nathan Kinkade --- cmd/kured/main.go | 8 ++++---- kured-ds.yaml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/kured/main.go b/cmd/kured/main.go index 9af206965..57674bc94 100644 --- a/cmd/kured/main.go +++ b/cmd/kured/main.go @@ -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)) } diff --git a/kured-ds.yaml b/kured-ds.yaml index 615db3d03..71ccb494f 100644 --- a/kured-ds.yaml +++ b/kured-ds.yaml @@ -83,3 +83,4 @@ spec: # - --annotate-nodes=false # - --lock-release-delay=30m # - --log-format=text +# - --metricsAddress=:8080