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 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 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 Workload ¶
type Workload struct { Header `yaml:",inline" json:",inline"` *Service `yaml:",inline" json:",inline"` *Job `yaml:",inline" json:",inline"` }
func (*Workload) MarshalJSON ¶
func (*Workload) MarshalYAML ¶
func (*Workload) UnmarshalJSON ¶
func (*Workload) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.