You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/livenessprobe/main.go
+44-6Lines changed: 44 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,10 @@ package main
19
19
import (
20
20
"context"
21
21
"flag"
22
+
"fmt"
22
23
"net"
23
24
"net/http"
25
+
"os"
24
26
"sync"
25
27
"time"
26
28
@@ -32,12 +34,17 @@ import (
32
34
"github.com/kubernetes-csi/csi-lib-utils/rpc"
33
35
)
34
36
37
+
const (
38
+
defaultHealthzPort="9808"
39
+
)
40
+
35
41
// Command line flags
36
42
var (
37
-
probeTimeout=flag.Duration("probe-timeout", time.Second, "Probe timeout in seconds")
43
+
probeTimeout=flag.Duration("probe-timeout", time.Second, "Probe timeout in seconds.")
38
44
csiAddress=flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
39
-
healthzPort=flag.String("health-port", "9808", "TCP ports for listening healthz requests")
40
-
metricsAddress=flag.String("metrics-address", "", "The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled.")
45
+
healthzPort=flag.String("health-port", defaultHealthzPort, fmt.Sprintf("(deprecated) TCP ports for listening healthz requests. The default is `%s`. If set, `--http-endpoint` cannot be set.", defaultHealthzPort))
46
+
metricsAddress=flag.String("metrics-address", "", "(deprecated) The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled. If set, `--http-endpoint` cannot be set, and the address cannot resolve to localhost + the port from `--health-port`.")
47
+
httpEndpoint=flag.String("http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including CSI driver health check and metrics. The default is empty string, which means the server is disabled. If set, `--health-port` and `--metrics-address` cannot be explicitly set.")
41
48
metricsPath=flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.")
0 commit comments