deis / deis/builder

Use a cheaper way to ping the Kubernetes API in the health check endpoint

Open
#180 3 comments 0 reactions 0 assignees View on GitHub
easy fix enhancement
Dominant language
Go
Stars
40
Forks
41
PR merge metrics
No merged PRs in 30d

Description

After #149, the health check server (`/healthz`) will be listing all namespaces in the cluster as a way to ping the Kubernetes API to determine whether it's available. This method of checking availability is more heavyweight than it has to be, since the API server should also have a `healthz` endpoint. Some code similar to the following should be used to check that endpoint:

``` go
// kubeClient is a *(k8s.io/kubernetes/pkg/client/unversioned).Client
res := kubeClient.Get().AbsPath("/healthz").Do()
if res.Error() != nil{
// not possible to reach the server
}
```

This idea was first proposed by @aledbf in https://github.com/deis/builder/pull/149/files#r52692363

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.