-
Notifications
You must be signed in to change notification settings - Fork 3
/
healthztype.go
31 lines (28 loc) · 1.67 KB
/
healthztype.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package keel
// HealthzType type
// https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
type HealthzType string
const (
// HealthzTypeAlways will run on any checks
HealthzTypeAlways HealthzType = "always"
// HealthzTypeStartup will run on /healthz/startup checks
// > The kubelet uses startup probes to know when a container application has started. If such a probe is configured,
// > it disables liveness and readiness checks until it succeeds, making sure those probes don't interfere with the
// > application startup. This can be used to adopt liveness checks on slow starting containers, avoiding them getting
// > killed by the kubelet before they are up and running.
HealthzTypeStartup HealthzType = "startup"
// HealthzTypeReadiness will run on /healthz/readiness checks
// > The kubelet uses readiness probes to know when a container is ready to start accepting traffic.
// > A Pod is considered ready when all of its containers are ready. One use of this signal is to control
// > which Pods are used as backends for Services. When a Pod is not ready, it is removed from Service load balancers.
HealthzTypeReadiness HealthzType = "readiness"
// HealthzTypeLiveness will run on /healthz/liveness checks
// > The kubelet uses liveness probes to know when to restart a container. For example, liveness probes could catch
// > a deadlock, where an application is running, but unable to make progress. Restarting a container in such a state
// > can help to make the application more available despite bugs.
HealthzTypeLiveness HealthzType = "liveness"
)
// String interface
func (t HealthzType) String() string {
return string(t)
}