github.com/thanos-io/thanos@v0.32.5/pkg/prober/prober.go (about)

     1  // Copyright (c) The Thanos Authors.
     2  // Licensed under the Apache License 2.0.
     3  
     4  package prober
     5  
     6  // Prober represents health and readiness status of given component.
     7  //
     8  // From Kubernetes documentation https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ :
     9  //
    10  //	liveness: Many applications running for long periods of time eventually transition to broken states,
    11  //	(healthy) and cannot recover except by being restarted.
    12  //	          Kubernetes provides liveness probes to detect and remedy such situations.
    13  //
    14  //	readiness: Sometimes, applications are temporarily unable to serve traffic.
    15  //	(ready)    For example, an application might need to load large data or configuration files during startup,
    16  //	           or depend on external services after startup. In such cases, you don’t want to kill the application,
    17  //	           but you don’t want to send it requests either. Kubernetes provides readiness probes to detect
    18  //	           and mitigate these situations. A pod with containers reporting that they are not ready
    19  //	           does not receive traffic through Kubernetes Services.
    20  type Probe interface {
    21  	Healthy()
    22  	NotHealthy(err error)
    23  	Ready()
    24  	NotReady(err error)
    25  }