ctrmon

package
v3.0.0-rc69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func (*Manager) Start

func (t *Manager) Start(parent context.Context) error

Start starts the container monitor, which runs the event stream of each engine while the node holds a container resource of it.

func (*Manager) Stop

func (t *Manager) Stop() error

Stop stops the container monitor manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL