workload

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldLabels      = "labels"
	FieldAnnotations = "annotations"
)
View Source
const (
	ModuleService                 = "service"
	ModuleServiceType             = "type"
	Deployment        ServiceType = "Deployment"
	Collaset          ServiceType = "CollaSet"
)
View Source
const (
	TypeJob       = core.BuiltinModulePrefix + "v1.workload.Job"
	TypeService   = core.BuiltinModulePrefix + "v1.workload.Service"
	FieldReplicas = "replicas"
)
View Source
const ModuleJob = "job"

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.
	Replicas *int32 `yaml:"replicas,omitempty" json:"replicas,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"`
	// 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"`
}

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 string `yaml:"_type" json:"_type"`
}

type Job

type Job struct {
	Base `yaml:",inline" json:",inline"`
	// The scheduling strategy in Cron format: 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"`
	Params    map[string]string `yaml:"params,omitempty" json:"params,omitempty"`
	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 represents the type of workload.Service, support Deployment and CollaSet.
	Type ServiceType `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 ServiceType

type ServiceType string

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