Documentation
¶
Overview ¶
Package ctrmon watches the state changes of the podman and docker containers, and publishes them as pubsub events, for the instances holding a container resource to evaluate their status again.
A container changes state with no action of the node to tell: its process exits, the kernel kills it for memory, an admin stops or removes it, its health check fails. Without the monitor, the change is seen at the next scheduled status: within the monitor schedule for a monitored resource, the status schedule otherwise, with the instance said up meanwhile.
It reads the event stream of each engine, "podman events" and "docker events", while the node holds a container resource of that engine: a node holding none has no container event to wait for, and a "docker events" keeps a connection to dockerd open (see package evwatch). A stream ending, as the engine restarting ends it, runs again after a delay, and the containers held are refreshed once it runs. Where an engine is not installed, its stream is disabled with a log line, until no container resource of it is left.
The containers a podman of a user runs, rootless, are in the storage of that user, which the event stream of root does not see: they are seen at the scheduled status, as before.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager watches the container events of each engine, and publishes a ContainerUpdated message for each container of the local instances whose state changed.
func NewManager ¶
func NewManager(drainDuration time.Duration, subQS pubsub.QueueSizer) *Manager
NewManager creates a new container monitor manager