create

package
v0.0.4-rc5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRegexp

func IsRegexp(str string) bool

func ParseConfigs

func ParseConfigs(configs []string) ([]client.ConfigMapping, error)

func ParseDevices

func ParseDevices(devices []string) ([]client.DeviceMapping, error)

func ParseDurationUnit

func ParseDurationUnit(s, name string, unit time.Duration) (int64, error)

func ParseExposedPorts

func ParseExposedPorts(specs []string) ([]client.ExposedPort, error)

func ParseMounts

func ParseMounts(spec []string) ([]client.Mount, error)

func ParsePermissions

func ParsePermissions(perms []string) ([]client.Permission, error)

func ParsePorts

func ParsePorts(specs []string) ([]client.PortBinding, error)

func ParseSecrets

func ParseSecrets(secrets []string) ([]client.SecretMapping, error)

func ParseStringMatch

func ParseStringMatch(str string) *client.StringMatch

func ParseTmpfs

func ParseTmpfs(specs []string) ([]client.Tmpfs, error)

Types

type Create

type Create struct {
	AddHost              []string          `desc:"Add a custom host-to-IP mapping (host:ip)"`
	AutoScaleMinScale    int               `desc:"Minimum scale autoscaler can scale to" default:"1"`
	AutoScaleMaxScale    int               `desc:"Maximum scale autoscaler can scale to" default:"30"`
	CapAdd               []string          `desc:"Add Linux capabilities"`
	CapDrop              []string          `desc:"Drop Linux capabilities"`
	Config               []string          `desc:"Configs to expose to the service (format: name:target)"`
	Cpus                 string            `desc:"Number of CPUs"`
	DeploymentStrategy   string            `desc:"Approach to creating containers (parallel|ordered)" default:"parallel"`
	Detach               bool              `desc:"Do not attach after when -it is specified"`
	Device               []string          `desc:"Add a host device to the container"`
	DnsOption            []string          `desc:"Set DNS options"`
	DnsSearch            []string          `desc:"Set custom DNS search domains"`
	Dns                  []string          `desc:"Set custom DNS servers"`
	Entrypoint           []string          `desc:"Overwrite the default ENTRYPOINT of the image"`
	E_Env                []string          `desc:"Set environment variables"`
	EnvFile              []string          `desc:"Read in a file of environment variables"`
	Expose               []string          `desc:"Expose a container's port(s) internally"`
	EnableAutoScale      bool              `desc:"Enable autoscaling for services"`
	ContainerConcurrency int               `desc:"The maximum concurrent request a container can handle(autoscaling)" default:"10"`
	GlobalPermission     []string          `desc:"Permissions to grant to container's service account for all stacks"`
	Group                string            `desc:"The GID to run the entrypoint of the container process"`
	HealthCmd            string            `desc:"Command to run to check health"`
	HealthInterval       string            `desc:"Time between running the check (ms|s|m|h)" default:"0s"`
	HealthRetries        int               `desc:"Consecutive successes needed to report healthy"`
	HealthStartPeriod    string            `desc:"Start period for the container to initialize before starting healthchecks (ms|s|m|h)" default:"0s"`
	HealthTimeout        string            `desc:"Maximum time to allow one check to run (ms|s|m|h)" default:"0s"`
	HealthURL            string            `desc:"URL to hit to check health (example: http://localhost:8080/ping)"`
	Hostname             string            `desc:"Container host name"`
	ImagePullPolicy      string            `desc:"Behavior determining when to pull the image (never|always|not-present)" default:"not-present"`
	Init                 bool              `desc:"Run an init inside the container that forwards signals and reaps processes"`
	I_Interactive        bool              `desc:"Keep STDIN open even if not attached"`
	Ipc                  string            `desc:"IPC mode to use"`
	L_Label              map[string]string `desc:"Set meta data on a container"`
	LabelFile            []string          `desc:"Read in a line delimited file of labels"`
	M_Memory             string            `desc:"Memory reservation (format: <number>[<unit>], where unit = b, k, m or g)"`
	MemoryLimit          string            `desc:"Memory hard limit (format: <number>[<unit>], where unit = b, k, m or g)"`
	Metadata             map[string]string `desc:"Metadata to attach to this service"`
	N_Name               string            `desc:"Assign a name to the container"`
	Net_Network          string            `desc:"Connect a container to a network (default|host)" default:"default"`
	Permission           []string          `desc:"Permissions to grant to container's service account in current stack"`
	Pid                  string            `desc:"PID namespace to use"`
	Privileged           bool              `desc:"Give extended privileges to this container"`
	P_Publish            []string          `desc:"Publish a container's port(s) externally"`
	ReadOnly             bool              `desc:"Mount the container's root filesystem as read only"`
	ReadyCmd             string            `desc:"Command to run to check readiness"`
	ReadyInterval        string            `desc:"Time between running the check (ms|s|m|h)" default:"0s"`
	ReadyRetries         int               `desc:"Consecutive successes needed to report ready"`
	ReadyStartPeriod     string            `desc:"Start period for the container to initialize before starting readychecks (ms|s|m|h)" default:"0s"`
	ReadyTimeout         string            `desc:"Maximum time to allow one check to run (ms|s|m|h)" default:"0s"`
	ReadyURL             string            `desc:"URL to hit to check readiness (example: http://localhost:8080/ping)"`
	Restart              string            `desc:"Restart policy to apply when a container exits" default:"always"`
	Secret               []string          `desc:"Secrets to inject to the service (format: name:target)"`
	SecurityOpt          []string          `desc:"Security Options"`
	StopTimeout          string            `desc:"Timeout (in seconds) to stop a container"`
	Tmpfs                []string          `desc:"Mount a tmpfs directory"`
	T_Tty                bool              `desc:"Allocate a pseudo-TTY"`
	UnhealthyRetries     int               `desc:"Consecutive failures needed to report unhealthy"`
	UnreadyRetries       int               `desc:"Consecutive failures needed to report unready"`
	UpdateOrder          string            `desc:"Update order when doing batched rolling container updates (start-first|stop-first)"`
	UpdateStrategy       string            `desc:"Approach to updating containers (rolling|on-delete)" default:"rolling"`
	U_User               string            `desc:"UID[:GID] Sets the UID used and optionally GID for entrypoint process (format: <uid>[:<gid>])"`
	VolumeDriver         string            `desc:"Optional volume driver for the container"`
	VolumesFrom          []string          `desc:"Mount volumes from the specified container(s)"`
	V_Volume             []string          `desc:"Bind mount a volume"`
	W_Workdir            string            `desc:"Working directory inside the container"`

	Scheduling
}

func (*Create) Run

func (c *Create) Run(ctx *clicontext.CLIContext) error

func (*Create) RunCallback

func (c *Create) RunCallback(ctx *clicontext.CLIContext, cb func(service *client.Service) *client.Service) (*client.Service, error)

func (*Create) ToService

func (c *Create) ToService(args []string) (*client.Service, error)

type Scheduling

type Scheduling struct {
	Global         bool     `desc:"Run one container per node (or some nodes depending on scheduling)"`
	Node           string   `desc:"Skip scheduling and run service on specified node"`
	NodePreferred  []string `desc:"Node running containers if possible should match expression"`
	NodeRequireAny []string `desc:"Node running containers must match one expression"`
	NodeRequire    []string `desc:"Node running containers must match all expressions"`
	Scheduler      string   `desc:"Use a custom scheduler of the given name"`
}

Source Files

  • config.go
  • create.go
  • device.go
  • duration.go
  • health.go
  • label.go
  • memory.go
  • mount.go
  • perm.go
  • ports.go
  • route.go
  • secret.go
  • tmpfs.go

Jump to

Keyboard shortcuts

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