Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Add Liveness Probe #202

Merged
merged 2 commits into from
Aug 10, 2018
Merged

Conversation

stevesloka
Copy link
Member

Fixes #142 by adding a /healthz endpoint and a default liveness probe to the Openstack discoverer. This is should detect the issue when the discoverer cannot authenticate properly to Openstack and cause the pod to restart.

@stevesloka stevesloka requested a review from alexbrand July 30, 2018 14:35
Copy link
Contributor

@alexbrand alexbrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! I was thinking it was going to be a pain to figure out how to make the process "crash", but using a liveness probe here takes that pain away.

<-stopCh
log.Info("Stopped OpenStack discoverer")
}

func healthzHandler(w http.ResponseWriter, r *http.Request) {
_, err := reconciler.ProjectLister.ListProjects()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it customary to discard this error? I am wondering if it makes sense to either log it or print it out in the HTTP response

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, the goal here is just to understand if the API is healthy or not. I'd expect the logic portions of the controller to log their errors in context.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense to me. I think we can move forward with discarding this error.

alexbrand
alexbrand previously approved these changes Aug 9, 2018
…a Probes

Signed-off-by: Steve Sloka <steves@heptio.com>
Signed-off-by: Steve Sloka <steves@heptio.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants