images

package
v0.18.2-0...-866293b Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package images is responsible for managing lifecycle of container images.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Container image pull failed, kubelet is backing off image pull
	ErrImagePullBackOff = errors.New("ImagePullBackOff")

	// Unable to inspect image
	ErrImageInspect = errors.New("ImageInspectError")

	// General image pull error
	ErrImagePull = errors.New("ErrImagePull")

	// Required Image is absent on host and PullPolicy is NeverPullImage
	ErrImageNeverPull = errors.New("ErrImageNeverPull")

	// Get http error when pulling image from registry
	RegistryUnavailable = errors.New("RegistryUnavailable")

	// Unable to parse the image name.
	ErrInvalidImageName = errors.New("InvalidImageName")
)

Functions

This section is empty.

Types

type ImageGCManager

type ImageGCManager interface {
	// Applies the garbage collection policy. Errors include being unable to free
	// enough space as per the garbage collection policy.
	GarbageCollect() error

	// Start async garbage collection of images.
	Start() error

	GetImageList() ([]kubecontainer.Image, error)

	// Delete all unused images and returns the number of bytes freed. The number of bytes freed is always returned.
	DeleteUnusedImages() (int64, error)
}

Manages lifecycle of all images.

Implementation is thread-safe.

func NewImageGCManager

func NewImageGCManager(runtime container.Runtime, cadvisorInterface cadvisor.Interface, recorder record.EventRecorder, nodeRef *api.ObjectReference, policy ImageGCPolicy) (ImageGCManager, error)

type ImageGCPolicy

type ImageGCPolicy struct {
	// Any usage above this threshold will always trigger garbage collection.
	// This is the highest usage we will allow.
	HighThresholdPercent int

	// Any usage below this threshold will never trigger garbage collection.
	// This is the lowest threshold we will try to garbage collect to.
	LowThresholdPercent int

	// Minimum age at which an image can be garbage collected.
	MinAge time.Duration
}

A policy for garbage collecting images. Policy defines an allowed band in which garbage collection will be run.

type ImageManager

type ImageManager interface {
	// EnsureImageExists ensures that image specified in `container` exists.
	EnsureImageExists(pod *api.Pod, container *api.Container, pullSecrets []api.Secret) (error, string)
}

ImageManager provides an interface to manage the lifecycle of images. Implementations of this interface are expected to deal with pulling (downloading), managing, and deleting container images. Implementations are expected to abstract the underlying runtimes. Implementations are expected to be thread safe.

func NewImageManager

func NewImageManager(recorder record.EventRecorder, imageService kubecontainer.ImageService, imageBackOff *flowcontrol.Backoff, serialized bool, qps float32, burst int) ImageManager

Jump to

Keyboard shortcuts

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