Skip to content

Commit

Permalink
etcdserver: add livez and ready http endpoints for etcd.
Browse files Browse the repository at this point in the history
Add two separate probes, one for liveness and one for readiness. The liveness probe would check that the local individual node is up and running, or else restart the node, while the readiness probe would check that the cluster is ready to serve traffic. This would make etcd health-check fully Kubernetes API complient.

Signed-off-by: Siyuan Zhang <[email protected]>
  • Loading branch information
siyuanfoundation committed Sep 26, 2023
1 parent e85949d commit 0705f0e
Show file tree
Hide file tree
Showing 4 changed files with 729 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/embed/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ func (e *Etcd) serveClients() (err error) {
etcdhttp.HandleVersion(mux, e.Server)
etcdhttp.HandleMetrics(mux)
etcdhttp.HandleHealth(e.cfg.logger, mux, e.Server)
e.Server.InstallLivezReadyz(e.cfg.logger, mux)

var gopts []grpc.ServerOption
if e.cfg.GRPCKeepAliveMinTime > time.Duration(0) {
Expand Down
Loading

0 comments on commit 0705f0e

Please sign in to comment.