server

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRootDir is the default location used by containerd to store
	// persistent data
	DefaultRootDir = "/var/lib/containerd"
	// DefaultStateDir is the default location used by containerd to store
	// transient data
	DefaultStateDir = "/run/containerd"
	// DefaultAddress is the default unix socket address
	DefaultAddress = "/run/containerd/containerd.sock"
	// DefaultDebugAddress is the default unix socket address for pprof data
	DefaultDebugAddress = "/run/containerd/debug.sock"
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string, v *Config) error

LoadConfig loads the containerd server config from the provided path

Types

type CgroupConfig

type CgroupConfig struct {
	Path string `toml:"path"`
}

type Config

type Config struct {
	// Root is the path to a directory where containerd will store persistent data
	Root string `toml:"root"`
	// State is the path to a directory where containerd will store transient data
	State string `toml:"state"`
	// GRPC configuration settings
	GRPC GRPCConfig `toml:"grpc"`
	// Debug and profiling settings
	Debug Debug `toml:"debug"`
	// Metrics and monitoring settings
	Metrics MetricsConfig `toml:"metrics"`
	// Plugins provides plugin specific configuration for the initialization of a plugin
	Plugins map[string]toml.Primitive `toml:"plugins"`
	// Enable containerd as a subreaper
	Subreaper bool `toml:"subreaper"`
	// OOMScore adjust the containerd's oom score
	OOMScore int `toml:"oom_score"`
	// Cgroup specifies cgroup information for the containerd daemon process
	Cgroup CgroupConfig `toml:"cgroup"`
	// contains filtered or unexported fields
}

Config provides containerd configuration data for the server

func (*Config) Decode

func (c *Config) Decode(id string, v interface{}) (interface{}, error)

Decode unmarshals a plugin specific configuration by plugin id

func (*Config) WriteTo

func (c *Config) WriteTo(w io.Writer) (int64, error)

WriteTo marshals the config to the provided writer

type Debug

type Debug struct {
	Address string `toml:"address"`
	Uid     int    `toml:"uid"`
	Gid     int    `toml:"gid"`
	Level   string `toml:"level"`
}

type GRPCConfig

type GRPCConfig struct {
	Address string `toml:"address"`
	Uid     int    `toml:"uid"`
	Gid     int    `toml:"gid"`
}

type MetricsConfig

type MetricsConfig struct {
	Address string `toml:"address"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the containerd main daemon

func New

func New(ctx context.Context, config *Config) (*Server, error)

New creates and initializes a new containerd server

func (*Server) ServeDebug

func (s *Server) ServeDebug(l net.Listener) error

ServeDebug provides a debug endpoint

func (*Server) ServeGRPC

func (s *Server) ServeGRPC(l net.Listener) error

ServeGRPC provides the containerd grpc APIs on the provided listener

func (*Server) ServeMetrics

func (s *Server) ServeMetrics(l net.Listener) error

ServeMetrics provides a prometheus endpoint for exposing metrics

func (*Server) Stop

func (s *Server) Stop()

Stop the containerd server canceling any open connections

Jump to

Keyboard shortcuts

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