Documentation
¶
Overview ¶
Package manager contains most of the implementation of the zeropod-manager node daemon. It takes care of loading eBPF programs, providing metrics and monitors the shims for status updates.
Index ¶
- Constants
- Variables
- func AttachRedirectors(ctx context.Context, log *slog.Logger, activatorOpts ...activator.BPFOpts) error
- func NewMigrationController(ctx context.Context, mgr manager.Manager, log *slog.Logger) error
- func NewPodController(ctx context.Context, mgr manager.Manager, log *slog.Logger, ...) error
- func StartSubscribers(ctx context.Context, sc SubscriberConfig, podHandlers ...PodHandler) error
- type Collector
- type EventCreator
- type PodControllerOption
- type PodHandler
- type PodHandlerWithClient
- type PodHandlerWithKubeClient
- type PodLabeller
- type PodScaler
- type Redirector
- type SubscriberConfig
Constants ¶
const ( LabelPodName = "pod" LabelPodNamespace = "namespace" MetricsNamespace = "zeropod" MetricCheckpointDuration = "checkpoint_duration_seconds" MetricRestoreDuration = "restore_duration_seconds" MetricLastCheckpointTime = "last_checkpoint_time" MetricLastRestoreTime = "last_restore_time" MetricRunning = "running" )
const ( CPUAnnotationKey = "zeropod.ctrox.dev/cpu-requests" MemoryAnnotationKey = "zeropod.ctrox.dev/memory-requests" )
const (
ControllerName = "zeropod.ctrox.dev/manager"
)
const (
StatusLabelKeyPrefix = "status.zeropod.ctrox.dev"
)
Variables ¶
var ( ScaledDownCPU = resource.MustParse("1m") ScaledDownMemory = resource.MustParse("1Ki") )
Functions ¶
func AttachRedirectors ¶ added in v0.2.0
func AttachRedirectors(ctx context.Context, log *slog.Logger, activatorOpts ...activator.BPFOpts) error
AttachRedirectors scans the zeropod maps path in the bpf file system for directories named after the pid of the sandbox container. It does an initial iteration over all directories and then starts a goroutine which watches for fsevents. When the associated netns of the sandbox container can be found it attaches the redirector BPF programs to the network interfaces of the sandbox. The directories are expected to be created by the zeropod shim on startup.
func NewMigrationController ¶ added in v0.10.0
func NewPodController ¶ added in v0.6.0
func StartSubscribers ¶ added in v0.3.0
func StartSubscribers(ctx context.Context, sc SubscriberConfig, podHandlers ...PodHandler) error
Types ¶
type Collector ¶ added in v0.6.0
type Collector struct {
// contains filtered or unexported fields
}
func NewCollector ¶ added in v0.6.0
func NewCollector() *Collector
func (*Collector) Collect ¶ added in v0.6.0
func (c *Collector) Collect(ch chan<- prometheus.Metric)
func (*Collector) Describe ¶ added in v0.6.0
func (c *Collector) Describe(ch chan<- *prometheus.Desc)
type EventCreator ¶ added in v0.7.0
type EventCreator struct {
// contains filtered or unexported fields
}
func NewEventCreator ¶ added in v0.7.0
func NewEventCreator(log *slog.Logger) *EventCreator
func (*EventCreator) Handle ¶ added in v0.7.0
func (ec *EventCreator) Handle(ctx context.Context, status *v1.ContainerStatus, pod *corev1.Pod) error
func (*EventCreator) InjectKubeClient ¶ added in v0.7.0
func (ec *EventCreator) InjectKubeClient(c client.Client)
type PodControllerOption ¶ added in v0.10.0
type PodControllerOption func(*podReconciler)
PodControllerOption is used for functional opts on the podReconciler.
func AutoGCMigrations ¶ added in v0.10.0
func AutoGCMigrations(gc bool) PodControllerOption
AutoGCMigrations configures the controller to attach an ownerReference on every migration to automatically garbage collect the migration object on owner pod deletion.
type PodHandler ¶ added in v0.4.0
type PodHandlerWithClient ¶ added in v0.6.0
type PodHandlerWithClient interface {
PodHandler
InjectClient(v1.ShimClient)
}
type PodHandlerWithKubeClient ¶ added in v0.7.0
type PodHandlerWithKubeClient interface {
PodHandler
InjectKubeClient(client.Client)
}
type PodLabeller ¶ added in v0.4.0
type PodLabeller struct {
// contains filtered or unexported fields
}
func NewPodLabeller ¶ added in v0.4.0
func NewPodLabeller(log *slog.Logger) *PodLabeller
func (*PodLabeller) Handle ¶ added in v0.4.0
func (pl *PodLabeller) Handle(ctx context.Context, status *v1.ContainerStatus, pod *corev1.Pod) error
type PodScaler ¶ added in v0.3.0
type PodScaler struct {
// contains filtered or unexported fields
}