workload

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeDeploy   = "Deployment"
	TypeCollaset = "CollaSet"
)
View Source
const (
	TypeJob     = "Job"
	TypeService = "Service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// The templates of containers to be run.
	Containers map[string]container.Container `yaml:"containers,omitempty" json:"containers,omitempty"`

	// The number of containers that should be run.
	// Default is 2 to meet high availability requirements.
	Replicas int `yaml:"replicas,omitempty" json:"replicas,omitempty"`

	// Labels and annotations can be used to attach arbitrary metadata
	// as key-value pairs to resources.
	Labels      map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`

	// Secret
	Secrets map[string]Secret `json:"secrets,omitempty" yaml:"secrets,omitempty"`

	// Dirs configures one or more volumes to be mounted to the
	// specified folder.
	Dirs map[string]string `json:"dirs,omitempty" yaml:"dirs,omitempty"`
}

Base defines set of attributes shared by different workload profile, e.g. Service and Job. You can inherit this Schema to reuse these common attributes.

type Header struct {
	Type Type `yaml:"_type" json:"_type"`
}

type Job

type Job struct {
	Base `yaml:",inline" json:",inline"`

	// The scheduling strategy in Cron format.
	// More info: https://en.wikipedia.org/wiki/Cron.
	Schedule string `yaml:"schedule,omitempty" json:"schedule,omitempty"`
}

Job is a kind of workload profile that describes how to run your application code. This is typically used for tasks that take from a few seconds to a few days to complete.

type Secret

type Secret struct {
	Type      string            `yaml:"type" json:"type"`
	Data      map[string]string `yaml:"data,omitempty" json:"data,omitempty"`
	Immutable bool              `yaml:"immutable,omitempty" json:"immutable,omitempty"`
}

type Service

type Service struct {
	Base `yaml:",inline" json:",inline"`
	Type string `yaml:"type" json:"type"`

	// Ports describe the list of ports need getting exposed.
	Ports []network.Port `yaml:"ports,omitempty" json:"ports,omitempty"`
}

Service is a kind of workload profile that describes how to run your application code. This is typically used for long-running web applications that should "never" go down, and handle short-lived latency-sensitive web requests, or events.

type Type

type Type string

type Workload

type Workload struct {
	Header   `yaml:",inline" json:",inline"`
	*Service `yaml:",inline" json:",inline"`
	*Job     `yaml:",inline" json:",inline"`
}

func (Workload) MarshalJSON

func (w Workload) MarshalJSON() ([]byte, error)

func (Workload) MarshalYAML

func (w Workload) MarshalYAML() (interface{}, error)

func (*Workload) UnmarshalJSON

func (w *Workload) UnmarshalJSON(data []byte) error

func (*Workload) UnmarshalYAML

func (w *Workload) UnmarshalYAML(unmarshal func(interface{}) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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