Documentation ¶
Index ¶
- Constants
- Variables
- func NewBulkStarter(starters []Starter) *bulkStarter
- type ActualContainerMetrics
- type BulkStarter
- type CommandFactory
- type ContainerNetworkMetricsProvider
- type ContainerNetworkStatMarshaller
- type Containerizer
- type Gardener
- func (g *Gardener) BulkInfo(handles []string) (map[string]garden.ContainerInfoEntry, error)
- func (g *Gardener) BulkMetrics(handles []string) (map[string]garden.ContainerMetricsEntry, error)
- func (g *Gardener) Capacity() (garden.Capacity, error)
- func (g *Gardener) Cleanup(log lager.Logger) error
- func (g *Gardener) Containers(props garden.Properties) ([]garden.Container, error)
- func (g *Gardener) Create(containerSpec garden.ContainerSpec) (ctr garden.Container, err error)
- func (g *Gardener) Destroy(handle string) error
- func (g *Gardener) GraceTime(container garden.Container) time.Duration
- func (g *Gardener) Lookup(handle string) (garden.Container, error)
- func (g *Gardener) Ping() error
- func (g *Gardener) Start() error
- func (g *Gardener) Stop() error
- type LinuxContainerNetworkMetricsProvider
- type Networker
- type NoopContainerNetworkMetricsProvider
- type NoopRestorer
- type NoopVolumizer
- func (NoopVolumizer) Capacity(lager.Logger) (uint64, error)
- func (NoopVolumizer) Create(lager.Logger, string, RootfsSpec) (specs.Spec, error)
- func (NoopVolumizer) Destroy(lager.Logger, string) error
- func (NoopVolumizer) GC(lager.Logger) error
- func (NoopVolumizer) Metrics(lager.Logger, string, bool) (garden.ContainerDiskStat, error)
- type Opener
- type PeaCleaner
- type PropertyManager
- type Restorer
- type RootfsSpec
- type Sleeper
- type Starter
- type StatsContainerMetrics
- type SysInfoProvider
- type UidGenerator
- type UidGeneratorFunc
- type VolumeCreator
- type VolumeDestroyMetricsGC
- type VolumeProvider
- type Volumizer
Constants ¶
View Source
const BridgeIPKey = "garden.network.host-ip"
View Source
const CleanupRetryLimit = 30
View Source
const CleanupRetrySleep = 3 * time.Second
View Source
const ContainerIPKey = "garden.network.container-ip"
View Source
const ContainerInterfaceKey = "garden.network.interface"
View Source
const ExternalIPKey = "garden.network.external-ip"
View Source
const GraceTimeKey = "garden.grace-time"
View Source
const MappedPortsKey = "garden.network.mapped-ports"
View Source
const RawRootFSScheme = "raw"
View Source
const VolumizerSession = "volumizer"
Variables ¶
View Source
var ErrGraphDisabled = errors.New("no image plugin configured")
Functions ¶
func NewBulkStarter ¶
func NewBulkStarter(starters []Starter) *bulkStarter
Types ¶
type ActualContainerMetrics ¶
type ActualContainerMetrics struct { StatsContainerMetrics CPUEntitlement uint64 }
type BulkStarter ¶
type BulkStarter interface {
StartAll() error
}
type CommandFactory ¶
type ContainerNetworkMetricsProvider ¶
type ContainerNetworkMetricsProvider interface {
Get(logger lager.Logger, handle string) (*garden.ContainerNetworkStat, error)
}
type ContainerNetworkStatMarshaller ¶
type ContainerNetworkStatMarshaller struct { }
func (*ContainerNetworkStatMarshaller) MarshalLink ¶
func (c *ContainerNetworkStatMarshaller) MarshalLink(link netlink.Link) string
func (*ContainerNetworkStatMarshaller) Unmarshal ¶
func (c *ContainerNetworkStatMarshaller) Unmarshal(s string) (*garden.ContainerNetworkStat, error)
type Containerizer ¶
type Containerizer interface { Create(log lager.Logger, desiredContainerSpec spec.DesiredContainerSpec) error Handles() ([]string, error) StreamIn(log lager.Logger, handle string, streamInSpec garden.StreamInSpec) error StreamOut(log lager.Logger, handle string, streamOutSpec garden.StreamOutSpec) (io.ReadCloser, error) Run(log lager.Logger, handle string, processSpec garden.ProcessSpec, io garden.ProcessIO) (garden.Process, error) Attach(log lager.Logger, handle string, processGUID string, io garden.ProcessIO) (garden.Process, error) Stop(log lager.Logger, handle string, kill bool) error Destroy(log lager.Logger, handle string) error RemoveBundle(log lager.Logger, handle string) error Info(log lager.Logger, handle string) (spec.ActualContainerSpec, error) Metrics(log lager.Logger, handle string) (ActualContainerMetrics, error) WatchRuntimeEvents(log lager.Logger) error Shutdown() error }
type Gardener ¶
type Gardener struct { // SysInfoProvider returns total memory and total disk SysInfoProvider SysInfoProvider // Containerizer runs and manages linux containers Containerizer Containerizer // UidGenerator generates unique ids for containers UidGenerator UidGenerator // BulkStarter runs any needed Starters that do start-up tasks (e.g. setting up cgroups) BulkStarter BulkStarter // Networker creates a network for containers Networker Networker // Volumizer creates volumes for containers Volumizer Volumizer Logger lager.Logger // PropertyManager creates map of container properties PropertyManager PropertyManager Sleep Sleeper // MaxContainers limits the advertised container capacity MaxContainers uint64 Restorer Restorer PeaCleaner PeaCleaner AllowPrivilgedContainers bool ContainerNetworkMetricsProvider ContainerNetworkMetricsProvider }
Gardener orchestrates other components to implement the Garden API
func New ¶
func New( uidGenerator UidGenerator, bulkStarter BulkStarter, sysInfoProvider SysInfoProvider, networker Networker, volumizer Volumizer, containerizer Containerizer, propertyManager PropertyManager, restorer Restorer, peaCleaner PeaCleaner, logger lager.Logger, maxContainers uint64, allowPrivilegedContainers bool, containerNetworkMetricsProvider ContainerNetworkMetricsProvider, ) *Gardener
func (*Gardener) BulkMetrics ¶
func (*Gardener) Containers ¶
type LinuxContainerNetworkMetricsProvider ¶
type LinuxContainerNetworkMetricsProvider struct {
// contains filtered or unexported fields
}
func NewLinuxContainerNetworkMetricsProvider ¶
func NewLinuxContainerNetworkMetricsProvider( containerizer Containerizer, propertyManager PropertyManager, fileOpener Opener, ) *LinuxContainerNetworkMetricsProvider
func (*LinuxContainerNetworkMetricsProvider) Get ¶
func (l *LinuxContainerNetworkMetricsProvider) Get(log lager.Logger, handle string) (*garden.ContainerNetworkStat, error)
type Networker ¶
type Networker interface { SetupBindMounts(log lager.Logger, handle string, privileged bool, rootfsPath string) ([]garden.BindMount, error) Network(log lager.Logger, spec garden.ContainerSpec, pid int) error Capacity() uint64 Destroy(log lager.Logger, handle string) error NetIn(log lager.Logger, handle string, hostPort, containerPort uint32) (uint32, uint32, error) BulkNetOut(log lager.Logger, handle string, rules []garden.NetOutRule) error NetOut(log lager.Logger, handle string, rule garden.NetOutRule) error Restore(log lager.Logger, handle string) error }
type NoopContainerNetworkMetricsProvider ¶
type NoopContainerNetworkMetricsProvider struct{}
func NewNoopContainerNetworkMetricsProvider ¶
func NewNoopContainerNetworkMetricsProvider() *NoopContainerNetworkMetricsProvider
func (NoopContainerNetworkMetricsProvider) Get ¶
func (n NoopContainerNetworkMetricsProvider) Get(_ lager.Logger, _ string) (*garden.ContainerNetworkStat, error)
type NoopRestorer ¶
type NoopRestorer struct{}
func (*NoopRestorer) Restore ¶
func (n *NoopRestorer) Restore(_ lager.Logger, handles []string) []string
type NoopVolumizer ¶
type NoopVolumizer struct{}
func (NoopVolumizer) Capacity ¶
func (NoopVolumizer) Capacity(lager.Logger) (uint64, error)
func (NoopVolumizer) Create ¶
func (NoopVolumizer) Create(lager.Logger, string, RootfsSpec) (specs.Spec, error)
func (NoopVolumizer) Destroy ¶
func (NoopVolumizer) Destroy(lager.Logger, string) error
func (NoopVolumizer) GC ¶
func (NoopVolumizer) GC(lager.Logger) error
func (NoopVolumizer) Metrics ¶
func (NoopVolumizer) Metrics(lager.Logger, string, bool) (garden.ContainerDiskStat, error)
type PeaCleaner ¶
type PropertyManager ¶
type PropertyManager interface { All(handle string) (props garden.Properties, err error) Set(handle string, name string, value string) Remove(handle string, name string) error Get(handle string, name string) (string, bool) MatchesAll(handle string, props garden.Properties) bool DestroyKeySpace(string) error }
type Restorer ¶
func NewRestorer ¶
type RootfsSpec ¶
type RootfsSpec struct { RootFS *url.URL Username string `json:"-"` Password string `json:"-"` Namespaced bool QuotaSize int64 QuotaScope garden.DiskLimitScope }
TODO GoRename RootfsSpec
type StatsContainerMetrics ¶
type StatsContainerMetrics struct { CPU garden.ContainerCPUStat Memory garden.ContainerMemoryStat Pid garden.ContainerPidStat Age time.Duration }
type SysInfoProvider ¶
type UidGenerator ¶
type UidGenerator interface {
Generate() string
}
type UidGeneratorFunc ¶
type UidGeneratorFunc func() string
func (UidGeneratorFunc) Generate ¶
func (fn UidGeneratorFunc) Generate() string
type VolumeCreator ¶
type VolumeCreator interface {
Create(log lager.Logger, handle string, spec RootfsSpec) (specs.Spec, error)
}
type VolumeDestroyMetricsGC ¶
type VolumeProvider ¶
type VolumeProvider struct { VolumeCreator VolumeCreator VolumeDestroyMetricsGC ContainerRootUID int ContainerRootGID int // contains filtered or unexported fields }
func NewVolumeProvider ¶
func NewVolumeProvider(creator VolumeCreator, manager VolumeDestroyMetricsGC, commandrunner commandrunner.CommandRunner, rootUID, rootGID int) *VolumeProvider
func (*VolumeProvider) Create ¶
func (v *VolumeProvider) Create(log lager.Logger, spec garden.ContainerSpec) (specs.Spec, error)
type Volumizer ¶
type Volumizer interface { Create(log lager.Logger, spec garden.ContainerSpec) (specs.Spec, error) VolumeDestroyMetricsGC }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.