Documentation
¶
Overview ¶
Package heartbeat manages per-controller liveness reporting for Kargo controllers. Each controller writes a coordination.k8s.io/v1.Lease to the Kargo namespace and renews it periodically; the API server lists those leases to derive controller liveness for the UI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAll ¶
func GetAll( ctx context.Context, c client.Reader, namespace string, ) (map[string]Heartbeat, error)
GetAll returns a map of Heartbeats from every controller that has reported in, indexed by controller name. Any controller without a corresponding key in the map has never produced a heartbeat and can therefore be assumed by the caller to be dead or nonexistent.
func NewRenewer ¶
func NewRenewer( c client.Client, namespace string, controllerName string, leaseDuration time.Duration, ) manager.Runnable
NewRenewer returns an implementation of controller-runtime's manager.Runnable interface that creates, renews, and (on shutdown) deletes a heartbeat record for a Kargo controller.
Types ¶
type Heartbeat ¶
type Heartbeat struct {
// Controller is the name of the controller as reported in the Lease's
// kargoapi.LabelKeyController label. This may be empty if the controller that
// produced the heartbeat was unnamed.
Controller string `json:"controller"`
// Status is point-in-time liveness synthesized from a heartbeat record.
Status Status `json:"status"`
// Timestamp is the timestamp of the heartbeat. nil when the underlying record
// carried no parseable timestamp.
Timestamp *time.Time `json:"timestamp,omitempty"`
}
Heartbeat describes what the heartbeat system knows about a single controller.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package heartbeattest provides helpers for tests that need to seed the heartbeat package's underlying storage.
|
Package heartbeattest provides helpers for tests that need to seed the heartbeat package's underlying storage. |