Documentation
¶
Index ¶
- func Environ(spec Spec, task Task) ([]string, error)
- type EnvVar
- type EnvVars
- type Envfile
- type HTTPGetAction
- type HostPath
- type Metadata
- type Metrics
- type NamedTaskdeprecated
- type Port
- type Ports
- type Probe
- func (p Probe) GetFailureThreshold() int
- func (p Probe) GetInitialDelay() time.Duration
- func (p Probe) GetPeriod() time.Duration
- func (p Probe) GetSuccessThreshold() int
- func (p Probe) MarshalJSON() ([]byte, error)
- func (p Probe) String() string
- func (p Probe) URL() *url.URL
- func (p *Probe) UnmarshalJSON(data []byte) error
- func (p *Probe) Unstring(s string) error
- type Spec
- type Strings
- type TCPSocketAction
- type Task
- func (t *Task) Environ() ([]string, error)
- func (t *Task) GetCommand() Strings
- func (t *Task) GetHostPorts() []uint16
- func (t *Task) GetLivenessProbe() *Probe
- func (t *Task) GetReadinessProbe() *Probe
- func (t *Task) GetRestartPolicy() string
- func (t *Task) GetStalledTimeout() time.Duration
- func (t *Task) GetType() TaskType
- func (t *Task) HasMutex() bool
- func (t *Task) Skip() bool
- func (t *Task) String() string
- type TaskType
- type Tasks
- type Volume
- type VolumeMount
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EnvVars ¶
A list of environment variables.
func (EnvVars) Environ ¶
Environ returns a list of environment variables. If an environment variable is defined in both the task and the host, the host value is used.
func (*EnvVars) UnmarshalJSON ¶
the legacy format for env vars was an array of named env vars
type HTTPGetAction ¶
type HTTPGetAction struct {
// Scheme to use for connecting to the host. Defaults to HTTP.
Scheme string `json:"scheme,omitempty"`
// Number of the port
Port uint16 `json:"port,omitempty"`
// Path to access on the HTTP server.
Path string `json:"path,omitempty"`
}
HTTPGetAction describes an action based on HTTP Locks requests.
func (HTTPGetAction) GetPort ¶
func (a HTTPGetAction) GetPort() uint16
func (HTTPGetAction) GetProto ¶
func (a HTTPGetAction) GetProto() string
func (HTTPGetAction) GetURL ¶
func (a HTTPGetAction) GetURL() string
func (HTTPGetAction) URL ¶
func (a HTTPGetAction) URL() *url.URL
func (*HTTPGetAction) Unstring ¶
func (a *HTTPGetAction) Unstring(s string) error
type HostPath ¶
type HostPath struct {
// Path of the directory on the host.
Path string `json:"path"`
}
type Metadata ¶
type Metadata struct {
// Name is the name of the resource.
Name string `json:"name,omitempty"`
// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
Annotations map[string]string `json:"annotations,omitempty"`
}
type Port ¶
type Port struct {
// The container port to expose
ContainerPort uint16 `json:"containerPort,omitempty"`
// The host port to route to the container port
HostPort uint16 `json:"hostPort,omitempty"`
}
A port to expose.
func (Port) GetHostPort ¶
func (Port) MarshalJSON ¶
func (*Port) UnmarshalJSON ¶
type Ports ¶
type Ports []Port
A list of ports to expose.
func (Ports) MarshalJSON ¶
func (*Ports) UnmarshalJSON ¶
type Probe ¶
type Probe struct {
// The action to perform.
TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"`
// The action to perform.
HTTPGet *HTTPGetAction `json:"httpGet,omitempty"`
// Number of seconds after the process has started before the probe is initiated.
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
// How often (in seconds) to perform the probe.
PeriodSeconds int32 `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed.
SuccessThreshold int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
FailureThreshold int32 `json:"failureThreshold,omitempty"`
}
A probe to check if the task is alive, it will be restarted if not.
func (Probe) GetFailureThreshold ¶
func (Probe) GetInitialDelay ¶
func (Probe) GetSuccessThreshold ¶
func (Probe) MarshalJSON ¶
func (*Probe) UnmarshalJSON ¶
type Spec ¶
type Spec struct {
// Port is the port that should be used for the user interface.
Port *uint16 `json:"port,omitempty"`
// TerminationGracePeriodSeconds is the grace period for terminating the workflow.
TerminationGracePeriodSeconds *int32 `json:"terminationGracePeriodSeconds,omitempty"`
// Tasks is a list of tasks that should be run.
Tasks Tasks `json:"tasks,omitempty"`
// Volumes is a list of volumes that can be mounted by containers belonging to the workflow.
Volumes []Volume `json:"volumes,omitempty"`
// Semaphores is a list of semaphores that can be acquired by tasks.
Semaphores map[string]int `json:"semaphores,omitempty"`
// Environment variables to set in the container or on the host
Env EnvVars `json:"env,omitempty"`
// Environment file (e.g. .env) to use
Envfile Envfile `json:"envfile,omitempty"`
}
Task is a unit of work that should be run.
func (*Spec) GetTerminationGracePeriod ¶
type TCPSocketAction ¶
type TCPSocketAction struct {
// Port number of the port to probe.
Port uint16 `json:"port"`
}
TCPSocketAction describes an action based on opening a socket
func (TCPSocketAction) URL ¶
func (a TCPSocketAction) URL() *url.URL
type Task ¶
type Task struct {
// Type is the type of the task: "service" or "job". If omitted, if there are ports, it's a service, otherwise it's a job.
// This is only needed when you have service that does not listen on ports.
// Services are running in the background.
Type TaskType `json:"type,omitempty"`
// Where to log the output of the task. E.g. if the task is verbose. Defaults to /dev/stdout. Maybe a file, or /dev/null.
Log string `json:"log,omitempty"`
// Either the container image to run, or a directory containing a Dockerfile. If omitted, the process runs on the host.
Image string `json:"image,omitempty"`
// Pull policy, e.g. Always, Never, IfNotPresent
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
// A probe to check if the task is alive, it will be restarted if not. If omitted, the task is assumed to be alive.
LivenessProbe *Probe `json:"livenessProbe,omitempty"`
// A probe to check if the task is ready to serve requests. If omitted, the task is assumed to be ready if when the first port is open.
ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
// The command to run in the container or on the host. If both the image and the command are omitted, this is a noop.
Command Strings `json:"command,omitempty"`
// The arguments to pass to the command
Args Strings `json:"args,omitempty"`
// The shell script to run, instead of the command
Sh string `json:"sh,omitempty"`
// A directories or files of Kubernetes manifests to apply. Once running the task will wait for the resources to be ready.
Manifests Strings `json:"manifests,omitempty"`
// The namespace to run the Kubernetes resource in. Defaults to the namespace of the current Kubernetes context.
Namespace string `json:"namespace,omitempty"`
// The working directory in the container or on the host
WorkingDir string `json:"workingDir,omitempty"`
// The user to run the task as.
User string `json:"user,omitempty"`
// Environment variables to set in the container or on the host
Env EnvVars `json:"env,omitempty"`
// Environment file (e.g. .env) to use
Envfile Envfile `json:"envfile,omitempty"`
// The ports to expose
Ports Ports `json:"ports,omitempty"`
// Volumes to mount in the container
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
// Use a pseudo-TTY
TTY bool `json:"tty,omitempty"`
// A list of files to watch for changes, and restart the task if they change
Watch Strings `json:"watch,omitempty"`
// A mutex to prevent multiple tasks with the same mutex from running at the same time
Mutex string `json:"mutex,omitempty"`
// A semaphore to limit the number of tasks with the same semaphore that can run at the same time
Semaphore string `json:"semaphore,omitempty"`
// A list of tasks to run before this task
Dependencies Strings `json:"dependencies,omitempty"`
// A list of files this task will create. If these exist, and they're newer than the watched files, the task is skipped.
Targets Strings `json:"targets,omitempty"`
// The restart policy, e.g. Always, Never, OnFailure. Defaults depends on the type of task.
RestartPolicy string `json:"restartPolicy,omitempty"`
// The timeout for the task to be considered stalled. If omitted, the task will be considered stalled after 30 seconds of no activity.
StalledTimeout *metav1.Duration `json:"stalledTimeout,omitempty"`
// The group this task belongs to. Tasks in the same group will be visually grouped together in the UI.
Group string `json:"group,omitempty"`
// Whether this is the default task to run if no task is specified.
Default bool `json:"default,omitempty"`
}
A task is a container or a command to run.
func (*Task) GetCommand ¶
func (*Task) GetHostPorts ¶
func (*Task) GetLivenessProbe ¶
func (*Task) GetReadinessProbe ¶
func (*Task) GetRestartPolicy ¶
func (*Task) GetStalledTimeout ¶
type Tasks ¶
func (*Tasks) UnmarshalJSON ¶
the legacy format for tasks was an array of named tasks
type VolumeMount ¶
type VolumeMount struct {
// This must match the name of a volume.
Name string `json:"name"`
// Path within the container at which the volume should be mounted.
MountPath string `json:"mountPath"`
}
VolumeMount describes a mounting of a Volume within a container.