workercmd

package
v6.7.3-0...-1f455d7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRoot = errors.New("worker must be run as root")

Functions

This section is empty.

Types

type Certs

type Certs struct {
	Dir string `long:"certs-dir" description:"Directory to use when creating the resource certificates volume."`
}

type CmdRunner

type CmdRunner struct {
	Cmd *exec.Cmd
}

func (CmdRunner) Run

func (runner CmdRunner) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type ContainerdRuntime

type ContainerdRuntime struct {
	Config         flag.File     `long:"config"     description:"Path to a config file to use for the Containerd daemon."`
	Bin            string        `long:"bin"        description:"Path to a containerd executable (non-absolute names get resolved from $PATH)."`
	InitBin        string        `` /* 144-byte string literal not displayed */
	CNIPluginsDir  string        `long:"cni-plugins-dir" default:"/usr/local/concourse/bin" description:"Path to CNI network plugins."`
	RequestTimeout time.Duration `` /* 126-byte string literal not displayed */

	//TODO can DNSConfig be simplifed to just a bool rather than struct with a bool?
	DNS                DNSConfig `group:"DNS Proxy Configuration" namespace:"dns-proxy"`
	DNSServers         []string  `` /* 138-byte string literal not displayed */
	RestrictedNetworks []string  `` /* 140-byte string literal not displayed */
	MaxContainers      int       `long:"max-containers" default:"250" description:"Max container capacity. 0 means no limit."`
	NetworkPool        string    `long:"network-pool" default:"10.80.0.0/16" description:"Network range to use for dynamically allocated container subnets."`
}

type DNSConfig

type DNSConfig struct {
	Enable bool `long:"enable" description:"Enable proxy DNS server."`
}

func (DNSConfig) Server

func (config DNSConfig) Server() (*dns.Server, error)

type GdnBinaryFlags

type GdnBinaryFlags struct {
	Server struct {
		Network struct {
			Pool string `long:"network-pool" description:"Network range to use for dynamically allocated container subnets. (default:10.80.0.0/16)"`
		} `group:"Container Networking"`

		Limits struct {
			MaxContainers string `long:"max-containers" description:"Maximum container capacity. 0 means no limit. (default:250)"`
		} `group:"Limits"`
	} `group:"server"`
}

Guardian binary flags - these are passed along as-is to the gdn binary as options.

Note: The defaults have been defined to suite Concourse, and are set manually. The go-flags method of setting defaults is not used as we need to detect whether the user passed in the value or not. This is needed in order to avoid unintentional overrides of user values set in the optional config file. See getGdnFlagsFromStruct for details.

type GuardianRuntime

type GuardianRuntime struct {
	Bin            string        `long:"bin"        description:"Path to a garden server executable (non-absolute names get resolved from $PATH)."`
	DNS            DNSConfig     `group:"DNS Proxy Configuration" namespace:"dns-proxy"`
	RequestTimeout time.Duration `` /* 133-byte string literal not displayed */

	Config      flag.File `` /* 134-byte string literal not displayed */
	BinaryFlags GdnBinaryFlags
}

type RuntimeConfiguration

type RuntimeConfiguration struct {
	Runtime string `` /* 210-byte string literal not displayed */
}

type WorkerCommand

type WorkerCommand struct {
	Worker WorkerConfig

	TSA worker.TSAConfig `group:"TSA Configuration" namespace:"tsa"`

	Certs Certs

	WorkDir flag.Dir `long:"work-dir" required:"true" description:"Directory in which to place container data."`

	BindIP   flag.IP `long:"bind-ip"   default:"127.0.0.1" description:"IP address on which to listen for the Garden server."`
	BindPort uint16  `long:"bind-port" default:"7777"      description:"Port on which to listen for the Garden server."`

	DebugBindIP   flag.IP `long:"debug-bind-ip"   default:"127.0.0.1" description:"IP address on which to listen for the pprof debugger endpoints."`
	DebugBindPort uint16  `long:"debug-bind-port" default:"7776"      description:"Port on which to listen for the pprof debugger endpoints."`

	HealthcheckBindIP   flag.IP       `long:"healthcheck-bind-ip"    default:"0.0.0.0"  description:"IP address on which to listen for health checking requests."`
	HealthcheckBindPort uint16        `long:"healthcheck-bind-port"  default:"8888"     description:"Port on which to listen for health checking requests."`
	HealthCheckTimeout  time.Duration `long:"healthcheck-timeout"    default:"5s"       description:"HTTP timeout for the full duration of health checking."`

	SweepInterval               time.Duration `` /* 133-byte string literal not displayed */
	VolumeSweeperMaxInFlight    uint16        `long:"volume-sweeper-max-in-flight" default:"3" description:"Maximum number of volumes which can be swept in parallel."`
	ContainerSweeperMaxInFlight uint16        `long:"container-sweeper-max-in-flight" default:"5" description:"Maximum number of containers which can be swept in parallel."`

	RebalanceInterval time.Duration `` /* 139-byte string literal not displayed */

	ConnectionDrainTimeout time.Duration `` /* 147-byte string literal not displayed */

	RuntimeConfiguration `group:"Runtime Configuration"`

	// This refers to flags relevant to the operation of the Guardian runtime.
	// For historical reasons it is namespaced under "garden" i.e. CONCOURSE_GARDEN instead of "guardian" i.e. CONCOURSE_GUARDIAN
	Guardian GuardianRuntime `group:"Guardian Configuration" namespace:"garden"`

	Containerd ContainerdRuntime `group:"Containerd Configuration" namespace:"containerd"`

	ExternalGardenURL flag.URL `` /* 146-byte string literal not displayed */

	Baggageclaim baggageclaimcmd.BaggageclaimCommand `group:"Baggageclaim Configuration" namespace:"baggageclaim"`

	ResourceTypes flag.Dir `long:"resource-types" description:"Path to directory containing resource types the worker should advertise."`

	Logger flag.Lager
}

func (*WorkerCommand) Execute

func (cmd *WorkerCommand) Execute(args []string) error

func (WorkerCommand) LessenRequirements

func (cmd WorkerCommand) LessenRequirements(prefix string, command *flags.Command)

func (*WorkerCommand) Runner

func (cmd *WorkerCommand) Runner(args []string) (ifrit.Runner, error)

type WorkerConfig

type WorkerConfig struct {
	Name     string   `long:"name"  description:"The name to set for the worker during registration. If not specified, the hostname will be used."`
	Tags     []string `long:"tag"   description:"A tag to set during registration. Can be specified multiple times."`
	TeamName string   `long:"team"  description:"The name of the team that this worker will be assigned to."`

	HTTPProxy  string `long:"http-proxy"  env:"http_proxy"                  description:"HTTP proxy endpoint to use for containers."`
	HTTPSProxy string `long:"https-proxy" env:"https_proxy"                 description:"HTTPS proxy endpoint to use for containers."`
	NoProxy    string `long:"no-proxy"    env:"no_proxy"                    description:"Blacklist of addresses to skip the proxy when reaching."`

	Ephemeral bool `long:"ephemeral" description:"If set, the worker will be immediately removed upon stalling."`

	Version string `` /* 130-byte string literal not displayed */
}

func (WorkerConfig) Worker

func (c WorkerConfig) Worker() atc.Worker

Jump to

Keyboard shortcuts

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