Skip to content

Add liveness endpoint to admin server#470

Merged
adleong merged 1 commit intomasterfrom
alex/its-alive
Apr 13, 2020
Merged

Add liveness endpoint to admin server#470
adleong merged 1 commit intomasterfrom
alex/its-alive

Conversation

@adleong
Copy link
Member

@adleong adleong commented Apr 10, 2020

Relates to linkerd/linkerd2#3984

Add a /live endpoint to the admin server which always returns a 200 success. This can be used for liveness checking.

Signed-off-by: Alex Leong [email protected]

@adleong adleong requested review from hawkw, olix0r and siggy April 10, 2020 21:10
@olix0r
Copy link
Member

olix0r commented Apr 10, 2020

@adleong Why not use the existing /ready endpoint, which is at least tied to identitiy?

@adleong
Copy link
Member Author

adleong commented Apr 10, 2020

See linkerd/linkerd2#3984 for a fuller discussion.

Kubernetes differentiates liveness and readiness. The /ready endpoint only returns successfully if the proxy is ready to accept traffic, even if it is alive. Currently, the /metrics endpoint is used to measure liveness.

@olix0r
Copy link
Member

olix0r commented Apr 10, 2020

But we don't want to consider the proxy live until it's received it's initial identity, do we? Afaict, that issue doesn't explain why we shouldn't use /ready, just that we shouldn't use /metrics.

@zaharidichev
Copy link
Member

@olix0r I do not think it will be considered live until the ready check returns true. I think the readyness checks need to pass and only then the liveliness checks kick in. So no I do not see a risk of k8s considering the proxy ready and alive before the identity is obtained.

@grampelberg
Copy link

The endpoint will only be added to the service once readiness passes. So, having a liveness check that succeeds before the readiness check is okay. The liveness check is used to restart the container, so we'll want that to be tied to events that require restarting and not readiness itself.

There's probably no real harm having readiness and liveness checks be the same today, as the liveness check itself is mostly just making sure the lights are on. That said, we'd want to split it out in the future if there were reasons to trigger a restart (leaking internal structures, deadlocks, ...).

@adleong adleong merged commit feed830 into master Apr 13, 2020
@adleong adleong deleted the alex/its-alive branch April 13, 2020 17:48
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Apr 15, 2020
This release includes a new protocol detection timeout, which prevents
clients from consuming resources indefinitely when they do not send any
data.

Additionally: the proxy's admin endpoint now supports a `/live` endpoint
for liveness checks, and a feature has been added to enrich tracing
metadata from a file of label/values.

---

* Add Labels from a path as oc-collector attributes (linkerd/linkerd2-proxy#463)
* Add liveness endpoint to admin server (linkerd/linkerd2-proxy#470)
* docker: Use buildkit for caching (linkerd/linkerd2-proxy#472)
* Makefile: Use STRIP variable with strip as default (linkerd/linkerd2-proxy#475)
* Add checksec to the release process (linkerd/linkerd2-proxy#476)
* Time out protocol detect futures (linkerd/linkerd2-proxy#464)
* Ensure that checksec is executable (linkerd/linkerd2-proxy#477)
* Fix the checksec URL (linkerd/linkerd2-proxy#478)
* Undo hardcoded release version (linkerd/linkerd2-proxy#479)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Apr 16, 2020
This release includes a new protocol detection timeout, which prevents
clients from consuming resources indefinitely when they do not send any
data.

Additionally: the proxy's admin endpoint now supports a `/live` endpoint
for liveness checks, and a feature has been added to enrich tracing
metadata from a file of label/values.

---

* Add Labels from a path as oc-collector attributes (linkerd/linkerd2-proxy#463)
* Add liveness endpoint to admin server (linkerd/linkerd2-proxy#470)
* docker: Use buildkit for caching (linkerd/linkerd2-proxy#472)
* Makefile: Use STRIP variable with strip as default (linkerd/linkerd2-proxy#475)
* Add checksec to the release process (linkerd/linkerd2-proxy#476)
* Time out protocol detect futures (linkerd/linkerd2-proxy#464)
* Ensure that checksec is executable (linkerd/linkerd2-proxy#477)
* Fix the checksec URL (linkerd/linkerd2-proxy#478)
* Undo hardcoded release version (linkerd/linkerd2-proxy#479)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants