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: README.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,9 @@ Read more about how to install the example webhook [here](deploy/kubernetes/webh
106
106
107
107
*`--leader-election-namespace <namespace>`: The namespace where the leader election resource exists. Defaults to the pod namespace if not set.
108
108
109
-
*`--metrics-address`: The TCP network address where the prometheus metrics endpoint will run (example: `:8080` which corresponds to port 8080 on local host). The default is empty string, which means metrics endpoint is disabled.
109
+
*`--http-endpoint`: The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080` which corresponds to port 8080 on local host). The default is empty string, which means the server is disabled.
110
+
111
+
*`--metrics-address`: (deprecated) The TCP network address where the prometheus metrics endpoint will run (example: `:8080` which corresponds to port 8080 on local host). The default is empty string, which means metrics endpoint is disabled.
110
112
111
113
*`--metrics-path`: The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.
112
114
@@ -147,6 +149,13 @@ Read more about how to install the example webhook [here](deploy/kubernetes/webh
147
149
148
150
* All glog / klog arguments are supported, such as `-v <log level>` or `-alsologtostderr`.
149
151
152
+
#### HTTP endpoint
153
+
154
+
The external-snapshotter optionally exposes an HTTP endpoint at address:port specified by `--http-endpoint` argument. When set, these two paths are exposed:
155
+
156
+
* Metrics path, as set by `--metrics-path` argument (default is `/metrics`).
157
+
158
+
* Leader election health check at `/healthz/leader-election`. It is recommended to run a liveness probe against this endpoint when leader election is used to kill external-provisioner leader that fails to connect to the API server to renew its leadership. See https://github.com/kubernetes-csi/csi-lib-utils/issues/66 for details.
leaderElectionNamespace=flag.String("leader-election-namespace", "", "The namespace where the leader election resource exists. Defaults to the pod namespace if not set.")
69
70
70
-
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.")
71
+
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. Only one of `--metrics-address` and `--http-endpoint` can be set.")
72
+
httpEndpoint=flag.String("http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.")
71
73
metricsPath=flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.")
72
74
)
73
75
@@ -112,6 +114,15 @@ func main() {
112
114
// Add Snapshot types to the default Kubernetes so events can be logged for them
113
115
snapshotscheme.AddToScheme(scheme.Scheme)
114
116
117
+
if*metricsAddress!=""&&*httpEndpoint!="" {
118
+
klog.Error("only one of `--metrics-address` and `--http-endpoint` can be set.")
0 commit comments