v1

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 14 Imported by: 60

Documentation

Index

Constants

View Source
const (
	AppTypeContainer = "container"
	AppTypeFunction  = "function"

	ServiceTypeDeployment  = "deployment"
	ServiceTypeStatefulSet = "statefulset"
	ServiceTypeDaemonSet   = "daemonset"
)
View Source
const (
	BaetylInit       = "baetyl-init"
	BaetylCore       = "baetyl-core"
	BaetylBroker     = "baetyl-broker"
	BaetylFunction   = "baetyl-function"
	BaetylRule       = "baetyl-rule"
	BaetylAgent      = "baetyl-agent"
	BaetylLog        = "baetyl-log"
	BaetylGPUMetrics = "baetyl-gpu-metrics"
)
View Source
const (
	KeySyncMode                 = "syncMode"
	CloudMode          SyncMode = "cloud"
	LocalMode          SyncMode = "local"
	KeyNodeProps                = "nodeprops"
	KeyDevices                  = "devices"
	KeyApps                     = "apps"
	KeySysApps                  = "sysapps"
	KeyAppStats                 = "appstats"
	KeySysAppStats              = "sysappstats"
	KeyAccelerator              = "accelerator"
	KeyCluster                  = "cluster"
	KeyOptionalSysApps          = "optionalSysApps"
	KeyNodeMode                 = "nodeMode"
	NVAccelerator               = "nvidia"
	ResourceGPU                 = "gpu"
	ResourceDisk                = "disk"
	KeyGPUUsedMemory            = "usedMemory"
	KeyGPUTotalMemory           = "totalMemory"
	KeyGPUPercent               = "percent"
	KeyDiskUsed                 = "diskUsed"
	KeyDiskTotal                = "diskTotal"
	KeyDiskPercent              = "diskPercent"
	KeyNetBytesSent             = "netBytesSent"
	KeyNetBytesRecv             = "netBytesRecv"
	KeyNetPacketsSent           = "netPacketsSent"
	KeyNetPacketsRecv           = "netPacketsRecv"
	KeyAppRequestCnt            = "requestCounter"

	BaetylCoreFrequency = "BaetylCoreFrequency"
	BaetylCoreAPIPort   = "BaetylCoreAPIPort"
	BaetylCoreVersion   = "BaetylCoreVersion"

	NodeOffline   = 0
	NodeOnline    = 1
	NodeUninstall = 2

	NodeModeKube   = "kube"
	NodeModeNative = "native"
)

maxJSONLevel the max level of json

View Source
const (
	HeaderKeyObjectUnpack = "baetyl-object-unpack"
	HeaderKeyObjectMD5    = "baetyl-object-md5"
	HeaderKeyObjectDir    = "baetyl-object-dir"
)
View Source
const (
	SecretLabel = "secret-type"
	// speical secret of the the registry
	SecretRegistry = "registry"
	// speical secret of the the config
	SecretConfig = "config"
	// speical secret of the the certificate
	SecretCertificate = "certificate"
	// speical custom secret of the the certificate
	SecretCustomCertificate = "custom-certificate"
)
View Source
const PrefixConfigObject = "_object_"

Variables

View Source
var ErrJSONLevelExceedsLimit = fmt.Errorf("the level of json exceeds the max limit (%d)", maxJSONLevel)

ErrJSONLevelExceedsLimit the level of json exceeds the max limit

Functions

func IsConfigObject added in v2.0.39

func IsConfigObject(key string) bool

Types

type ActiveRequest

type ActiveRequest struct {
	BatchName        string            `yaml:"batchName,omitempty" json:"batchName,omitempty"`
	Namespace        string            `yaml:"namespace,omitempty" json:"namespace,omitempty"`
	FingerprintValue string            `yaml:"fingerprintValue,omitempty" json:"fingerprintValue,omitempty"`
	SecurityType     string            `yaml:"securityType,omitempty" json:"securityType,omitempty"`
	SecurityValue    string            `yaml:"securityValue,omitempty" json:"securityValue,omitempty"`
	PenetrateData    map[string]string `yaml:"penetrateData,omitempty" json:"penetrateData,omitempty"`
}

ActiveRequest body of active request

type ActiveResponse

type ActiveResponse struct {
	NodeName    string            `yaml:"nodeName,omitempty" json:"nodeName,omitempty"`
	Namespace   string            `yaml:"namespace,omitempty" json:"namespace,omitempty"`
	Certificate utils.Certificate `yaml:"certificate,omitempty" json:"certificate,omitempty"`
}

ActiveResponse body of active responce

type AppInfo

type AppInfo struct {
	Name    string `yaml:"name,omitempty" json:"name,omitempty"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

AppInfo app info

type AppStats

type AppStats struct {
	AppInfo       `yaml:",inline" json:",inline"`
	DeployType    string                   `json:"deployType,omitempty" yaml:"deployType,omitempty"`
	Status        Status                   `yaml:"status,omitempty" json:"status,omitempty"`
	Cause         string                   `yaml:"cause,omitempty" json:"cause,omitempty"`
	InstanceStats map[string]InstanceStats `yaml:"instances,omitempty" json:"instances,omitempty"`
}

AppStats app statistics

type Application

type Application struct {
	Name              string            `json:"name,omitempty" yaml:"name,omitempty" validate:"resourceName"`
	Type              string            `json:"type,omitempty" yaml:"type,omitempty" default:"container"`
	Mode              string            `json:"mode,omitempty" yaml:"mode,omitempty" default:"kube"`
	Labels            map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Namespace         string            `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	CreationTimestamp time.Time         `json:"createTime,omitempty" yaml:"createTime,omitempty"`
	Version           string            `json:"version,omitempty" yaml:"version,omitempty"`
	Selector          string            `json:"selector,omitempty" yaml:"selector,omitempty"`
	NodeSelector      string            `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
	Services          []Service         `json:"services,omitempty" yaml:"services,omitempty" validate:"dive"`
	Volumes           []Volume          `json:"volumes,omitempty" yaml:"volumes,omitempty" validate:"dive"`
	Description       string            `json:"description,omitempty" yaml:"description,omitempty"`
	System            bool              `json:"system,omitempty" yaml:"system,omitempty"`
	CronStatus        CronStatusCode    `json:"cronStatus,omitempty" yaml:"cronStatus,omitempty" default:"0"`
	CronTime          time.Time         `json:"cronTime,omitempty" yaml:"cronTime,omitempty"`
}

Application application info

type Configuration

type Configuration struct {
	Name              string            `json:"name,omitempty" yaml:"name,omitempty" validate:"resourceName"`
	Namespace         string            `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Labels            map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Data              map[string]string `json:"data,omitempty" yaml:"data,omitempty" default:"{}" binding:"required"`
	CreationTimestamp time.Time         `json:"createTime,omitempty" yaml:"createTime,omitempty"`
	UpdateTimestamp   time.Time         `json:"updateTime,omitempty" yaml:"updateTime,omitempty"`
	Description       string            `json:"description,omitempty" yaml:"description,omitempty"`
	Version           string            `json:"version,omitempty" yaml:"version,omitempty"`
	System            bool              `json:"system,omitempty" yaml:"system,omitempty"`
}

Configuration config info

type ConfigurationObject

type ConfigurationObject struct {
	// hex format
	MD5      string            `json:"md5,omitempty" yaml:"md5,omitempty"`
	Sha256   string            `json:"sha256,omitempty" yaml:"sha256,omitempty"`
	URL      string            `json:"url,omitempty" yaml:"url,omitempty"`
	Token    string            `json:"token,omitempty" yaml:"token,omitempty"`
	Unpack   string            `json:"unpack,omitempty" yaml:"unpack,omitempty"`
	Metadata map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}

ConfigurationObject extended feature for object configuration

type ContainerPort

type ContainerPort struct {
	HostPort      int32  `json:"hostPort,omitempty" yaml:"hostPort,omitempty"`
	ContainerPort int32  `json:"containerPort,omitempty" yaml:"containerPort,omitempty"`
	Protocol      string `json:"protocol,omitempty" yaml:"protocol,omitempty"`
	HostIP        string `json:"hostIP,omitempty" yaml:"hostIP,omitempty"`
}

ContainerPort port config in container

type CoreInfo

type CoreInfo struct {
	GoVersion   string `yaml:"goVersion,omitempty" json:"goVersion,omitempty"`
	BinVersion  string `yaml:"binVersion,omitempty" json:"binVersion,omitempty"`
	GitRevision string `yaml:"gitRevision,omitempty" json:"gitRevision,omitempty"`
}

type CronStatusCode added in v2.2.3

type CronStatusCode int
const (
	CronNotSet   CronStatusCode = 0
	CronWait     CronStatusCode = 1
	CronFinished CronStatusCode = 2
)

type Delta added in v2.0.61

type Delta map[string]interface{}

Delta delta data

type Desire

type Desire map[string]interface{}

Desire desire data

func (Desire) AppInfos

func (d Desire) AppInfos(isSys bool) []AppInfo

func (Desire) AppStats

func (d Desire) AppStats(isSys bool) []AppStats

func (Desire) DeviceInfos added in v2.1.26

func (d Desire) DeviceInfos() []DeviceInfo

func (Desire) Diff

func (d Desire) Diff(reported Report) (Desire, error)

Diff diff with reported data, return the delta for desire

func (Desire) DiffWithNil added in v2.0.61

func (d Desire) DiffWithNil(report Report) (Delta, error)

Diff desire diff with report data, return the delta for desire and do not clean nil in delta

func (Desire) Merge

func (d Desire) Merge(desired Desire) error

Merge merge new reported data

func (Desire) Patch added in v2.0.61

func (d Desire) Patch(delta Delta) (Desire, error)

Patch patch desire with delta, get the new desire

func (Desire) SetAppInfos

func (d Desire) SetAppInfos(isSys bool, apps []AppInfo)

func (Desire) SetAppStats

func (d Desire) SetAppStats(isSys bool, stats []AppStats)

func (Desire) SetDeviceInfos added in v2.1.26

func (d Desire) SetDeviceInfos(devs []DeviceInfo)

type DesireRequest

type DesireRequest struct {
	Infos []ResourceInfo `yaml:"infos" json:"infos"`
}

DesireRequest body of request to sync desired data

type DesireResponse

type DesireResponse struct {
	Values []ResourceValue `yaml:"values" json:"values"`
}

DesireResponse body of response to sync desired data

type Device

type Device struct {
	DevicePath  string `json:"devicePath,omitempty" yaml:"devicePath,omitempty"`
	Policy      string `json:"policy,omitempty" yaml:"policy,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

VolumeDevice device volume config

type DeviceInfo added in v2.1.26

type DeviceInfo struct {
	Name    string `yaml:"name,omitempty" json:"name,omitempty"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

type Environment

type Environment struct {
	Name  string `json:"name,omitempty" yaml:"name,omitempty"`
	Value string `json:"value,omitempty" yaml:"value,omitempty"`
}

Environment environment config

type HostPathVolumeSource

type HostPathVolumeSource struct {
	Path string `json:"path,omitempty" yaml:"path,omitempty"`
}

HostPathVolumeSource volume source of host path

type InstanceStats

type InstanceStats struct {
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	ServiceName string            `yaml:"serviceName,omitempty" json:"serviceName"`
	Usage       map[string]string `yaml:"usage,omitempty" json:"usage,omitempty"`
	Extension   interface{}       `yaml:"extension,omitempty" json:"extension,omitempty"`
	Status      Status            `yaml:"status,omitempty" json:"status,omitempty"`
	Cause       string            `yaml:"cause,omitempty" json:"cause,omitempty"`
	IP          string            `yaml:"ip,omitempty" json:"ip,omitempty"`
	NodeName    string            `yaml:"nodeName,omitempty" json:"nodeName,omitempty"`
	CreateTime  time.Time         `yaml:"createTime,omitempty" json:"createTime,omitempty"`
}

InstanceStats instance stats

type Kind

type Kind string

Kind app model kind, crd on k8s

const (
	KindNode          Kind = "node"
	KindApp           Kind = "app"
	KindApplication   Kind = "application"
	KindConfig        Kind = "config"
	KindConfiguration Kind = "configuration"
	KindSecret        Kind = "secret"
)

All kinds

type LazyValue added in v2.0.49

type LazyValue struct {
	Value interface{}
	// contains filtered or unexported fields
}

VariableValue variable value which can be app, config or secret

func (*LazyValue) ExactUnmarshal added in v2.1.41

func (v *LazyValue) ExactUnmarshal(obj interface{}) error

func (*LazyValue) GetJSON added in v2.0.53

func (v *LazyValue) GetJSON() []byte

GetJSON get the json doc

func (LazyValue) MarshalJSON added in v2.0.49

func (v LazyValue) MarshalJSON() ([]byte, error)

MarshalJSON marshal to json data

func (*LazyValue) SetJSON added in v2.0.51

func (v *LazyValue) SetJSON(doc []byte)

SetJSON set the json doc

func (*LazyValue) Unmarshal added in v2.0.49

func (v *LazyValue) Unmarshal(obj interface{}) error

Unmarshal unmarshal from json data to obj

func (*LazyValue) UnmarshalJSON added in v2.0.49

func (v *LazyValue) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshal from json data

type Message added in v2.0.18

type Message struct {
	Kind     MessageKind       `yaml:"kind" json:"kind"`
	Metadata map[string]string `yaml:"meta" json:"meta"`
	Content  LazyValue         `yaml:"content" json:"content"`
}

Message general structure for http and ws sync

type MessageKind added in v2.0.18

type MessageKind string

MessageKind message kind

const (
	// MessageReport report message kind
	MessageReport MessageKind = "report"
	// MessageDesire desire message kind
	MessageDesire MessageKind = "desire"
	// MessageKeep keep alive message kind
	MessageKeep MessageKind = "keepalive"
	// MessageCMD command message kind
	MessageCMD MessageKind = "cmd"
	// MessageData data message kind
	MessageData MessageKind = "data"
	// MessageError error message kind
	MessageError MessageKind = "error"
	// Message response message kind
	MessageResponse MessageKind = "response"
	// MessageDelta delta message kind
	MessageDelta MessageKind = "delta"
	// MessageEvent event message = "event"
	MessageEvent MessageKind = "event"
	// MessageNodeProps node props message kind
	MessageNodeProps MessageKind = "nodeProps"
	// MessageDevices devices message kind
	MessageDevices MessageKind = "devices"
	// MessageDeviceEvent device event message kind
	MessageDeviceEvent MessageKind = "deviceEvent"
	// MessageReport device report message kind
	MessageDeviceReport MessageKind = "deviceReport"
	// MessageDesire device desire message kind
	MessageDeviceDesire MessageKind = "deviceDesire"
	// MessageDesire device delta message kind
	MessageDeviceDelta MessageKind = "deviceDelta"

	// MessageCommandConnect start remote debug command
	MessageCommandConnect = "connect"
	// MessageCommandDisconnect stop remote debug command
	MessageCommandDisconnect = "disconnect"
	// MessageCommandLogs logs
	MessageCommandLogs = "logs"
	// MessageCommandNodeLabel label the edge cluster nodes
	MessageCommandNodeLabel = "nodeLabel"
	// MessageCommandMultiNodeLabels label multiple nodes
	MessageCommandMultiNodeLabels = "multiNodeLabels"
)

type Node

type Node struct {
	Namespace         string                 `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Name              string                 `json:"name,omitempty" yaml:"name,omitempty" validate:"omitempty,resourceName"`
	Version           string                 `json:"version,omitempty" yaml:"version,omitempty"`
	CreationTimestamp time.Time              `json:"createTime,omitempty" yaml:"createTime,omitempty"`
	Accelerator       string                 `json:"accelerator,omitempty" yaml:"accelerator,omitempty"`
	Mode              SyncMode               `json:"mode,omitempty" yaml:"mode,omitempty"`
	NodeMode          string                 `json:"nodeMode,omitempty" yaml:"nodeMode,omitempty"`
	Cluster           bool                   `json:"cluster,omitempty" yaml:"cluster,omitempty"`
	Labels            map[string]string      `json:"labels,omitempty" yaml:"labels,omitempty" validate:"omitempty,validLabels"`
	Annotations       map[string]string      `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	Attributes        map[string]interface{} `json:"attr,omitempty" yaml:"attr,omitempty"`
	Report            Report                 `json:"report,omitempty" yaml:"report,omitempty"`
	Desire            Desire                 `json:"desire,omitempty" yaml:"desire,omitempty"`
	SysApps           []string               `json:"sysApps,omitempty" yaml:"sysApps,omitempty"`
	Description       string                 `json:"description,omitempty" yaml:"description,omitempty"`
}

Node the spec of node

func (*Node) View

func (n *Node) View(timeout time.Duration) (*NodeView, error)

type NodeInfo

type NodeInfo struct {
	Hostname         string            `yaml:"hostname,omitempty" json:"hostname,omitempty"`
	Address          string            `yaml:"address,omitempty" json:"address,omitempty"`
	Arch             string            `yaml:"arch,omitempty" json:"arch,omitempty"`
	KernelVersion    string            `yaml:"kernelVer,omitempty" json:"kernelVer,omitempty"`
	OS               string            `yaml:"os,omitempty" json:"os,omitempty"`
	ContainerRuntime string            `yaml:"containerRuntime,omitempty" json:"containerRuntime"`
	MachineID        string            `yaml:"machineID,omitempty" json:"machineID"`
	BootID           string            `yaml:"bootID,omitempty" json:"bootID"`
	SystemUUID       string            `yaml:"systemUUID,omitempty" json:"systemUUID"`
	OSImage          string            `yaml:"osImage,omitempty" json:"osImage"`
	Variant          string            `yaml:"variant,omitempty" json:"variant,omitempty"`
	HostID           string            `yaml:"hostID,omitempty" json:"hostID,omitempty"`
	Role             string            `yaml:"role,omitempty" json:"role,omitempty"`
	Labels           map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"  validate:"omitempty,validLabels"`
	ClientIP         string            `yaml:"clientIP,omitempty" json:"clientIP,omitempty"`
}

NodeInfo node info

type NodeStats

type NodeStats struct {
	DiskPressure       bool              `yaml:"diskPressure,omitempty" json:"diskPressure,omitempty"`
	MemoryPressure     bool              `yaml:"memoryPressure,omitempty" json:"memoryPressure,omitempty"`
	PIDPressure        bool              `yaml:"pidPressure,omitempty" json:"pidPressure,omitempty"`
	NetworkUnavailable bool              `yaml:"networkUnavailable,omitempty" json:"NetworkUnavailable,omitempty"`
	Ready              bool              `yaml:"ready,omitempty" json:"ready,omitempty"`
	Usage              map[string]string `yaml:"usage,omitempty" json:"usage,omitempty"`
	Capacity           map[string]string `yaml:"capacity,omitempty" json:"capacity,omitempty"`
	Percent            map[string]string `yaml:"percent,omitempty" json:"percent,omitempty"`
	NetIO              map[string]string `yaml:"netio,omitempty" json:"netio,omitempty"`
	Extension          interface{}       `yaml:"extension,omitempty" json:"extension,omitempty"`
}

NodeStats node statistics

type NodeView

type NodeView struct {
	Namespace         string            `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Name              string            `json:"name,omitempty" yaml:"name,omitempty"`
	Version           string            `json:"version,omitempty" yaml:"version,omitempty"`
	CreationTimestamp time.Time         `json:"createTime,omitempty" yaml:"createTime,omitempty"`
	Accelerator       string            `json:"accelerator,omitempty" yaml:"accelerator,omitempty"`
	Labels            map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations       map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	Report            *ReportView       `json:"report,omitempty" yaml:"report,omitempty"`
	AppMode           string            `json:"appMode,omitempty" yaml:"appMode,omitempty"`
	Desire            Desire            `json:"desire,omitempty" yaml:"desire,omitempty"`
	SysApps           []string          `json:"sysApps,omitempty" yaml:"sysApps,omitempty"`
	Description       string            `json:"description,omitempty" yaml:"description,omitempty"`
	Cluster           bool              `json:"cluster" yaml:"cluster"`
	Ready             int               `json:"ready"`
	Mode              SyncMode          `json:"mode"`
	NodeMode          string            `json:"nodeMode,omitempty" yaml:"nodeMode,omitempty"`
}

type ObjectReference

type ObjectReference struct {
	Name    string `json:"name,omitempty" yaml:"name,omitempty"`
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
}

ObjectReference object reference to config or secret

type Report

type Report map[string]interface{}

Report report data

func (Report) AppInfos

func (r Report) AppInfos(isSys bool) []AppInfo

func (Report) AppStats

func (r Report) AppStats(isSys bool) []AppStats

func (Report) DeviceInfos added in v2.1.26

func (r Report) DeviceInfos() []DeviceInfo

func (Report) Merge

func (r Report) Merge(reported Report) error

Merge merge new reported data

func (Report) Patch added in v2.0.61

func (r Report) Patch(delta Delta) (Report, error)

Patch patch report with delta, get the new report

func (Report) SetAppInfos

func (r Report) SetAppInfos(isSys bool, apps []AppInfo)

func (Report) SetAppStats

func (r Report) SetAppStats(isSys bool, stats []AppStats)

func (Report) SetDeviceInfos added in v2.1.26

func (r Report) SetDeviceInfos(devs []DeviceInfo)

type ReportView

type ReportView struct {
	Time        *time.Time            `json:"time,omitempty" yaml:"time,omitempty"`
	Apps        []AppInfo             `json:"apps,omitempty" yaml:"apps,omitempty"`
	SysApps     []AppInfo             `json:"sysapps,omitempty" yaml:"sysapps,omitempty"`
	Core        *CoreInfo             `json:"core,omitempty" yaml:"core,omitempty"`
	AppStats    []AppStats            `json:"appstats,omitempty" yaml:"appstats,omitempty"`
	SysAppStats []AppStats            `json:"sysappstats,omitempty" yaml:"sysappstats,omitempty"`
	Node        map[string]*NodeInfo  `json:"node,omitempty" yaml:"node,omitempty"`
	NodeStats   map[string]*NodeStats `json:"nodestats,omitempty" yaml:"nodestats,omitempty"`
	NodeInsNum  map[string]int        `json:"nodeinsnum,omitempty" yaml:"nodeinsnum,omitempty"`
	ModeInfo    string                `yaml:"modeinfo,omitempty" json:"modeinfo,omitempty"`
}

type ResourceInfo

type ResourceInfo struct {
	Kind    Kind   `yaml:"kind,omitempty" json:"kind,omitempty"`
	Name    string `yaml:"name,omitempty" json:"name,omitempty"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

ResourceInfo desired info

type ResourceValue

type ResourceValue struct {
	ResourceInfo `yaml:",inline" json:",inline"`
	Value        LazyValue `yaml:"value,omitempty" json:"value,omitempty"`
}

ResourceValue desired value

func (*ResourceValue) App

func (v *ResourceValue) App() *Application

App return app data if its kind is app

func (*ResourceValue) Config

func (v *ResourceValue) Config() *Configuration

Config return config data if its kind is config

func (*ResourceValue) Secret

func (v *ResourceValue) Secret() *Secret

Secret return secret data if its kind is secret

type Resources

type Resources struct {
	Limits   map[string]string `json:"limits,omitempty" yaml:"limits,omitempty"`
	Requests map[string]string `json:"requests,omitempty" yaml:"requests,omitempty"`
}

Resources resources config

type Retry

type Retry struct {
	Max int `json:"max,omitempty" yaml:"max,omitempty"`
}

Retry retry config

type Secret

type Secret struct {
	Name              string            `json:"name,omitempty" yaml:"name,omitempty" validate:"resourceName"`
	Namespace         string            `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Labels            map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations       map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	Data              map[string][]byte `json:"data,omitempty" yaml:"data,omitempty"`
	CreationTimestamp time.Time         `json:"createTime,omitempty" yaml:"createTime,omitempty"`
	UpdateTimestamp   time.Time         `json:"updateTime,omitempty" yaml:"updateTime,omitempty"`
	Description       string            `json:"description,omitempty" yaml:"description,omitempty"`
	Version           string            `json:"version,omitempty" yaml:"version,omitempty"`
	System            bool              `json:"system,omitempty" yaml:"system,omitempty"`
}

Secret secret info

type SecurityContext

type SecurityContext struct {
	Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"`
}

type Service

type Service struct {
	// specifies the unique name of the service
	Name string `json:"name,omitempty" yaml:"name,omitempty" binding:"required" validate:"serviceName"`
	// specifies the hostname of the service
	Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"`
	// specifies the image of the service, usually using the Docker image name
	Image string `json:"image,omitempty" yaml:"image,omitempty"`
	// specifies the number of instances started
	Replica int `json:"replica,omitempty" yaml:"replica,omitempty" binding:"required" default:"1"`
	// specifies the storage volumes that the service needs, map the storage volume to the directory in the container
	VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" yaml:"volumeMounts,omitempty"`
	// specifies the port bindings which exposed by the service, only for Docker container mode
	Ports []ContainerPort `json:"ports,omitempty" yaml:"ports,omitempty"`
	// specifies the device bindings which used by the service, only for Docker container mode
	Devices []Device `json:"devices,omitempty" yaml:"devices,omitempty"`
	// specifies the startup arguments of the service program, but does not include `arg[0]`
	Args []string `json:"args,omitempty" yaml:"args,omitempty"`
	// specifies the environment variable of the service program
	Env []Environment `json:"env,omitempty" yaml:"env,omitempty"`
	// specifies resource limits for a single instance of the service,  only for Docker container mode
	Resources *Resources `json:"resources,omitempty" yaml:"resources,omitempty"`
	// specifies runtime to use, only for Docker container mode
	Runtime string `json:"runtime,omitempty" yaml:"runtime,omitempty"`
	// labels
	Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	// specifies the security context of service
	SecurityContext *SecurityContext `json:"security,omitempty" yaml:"security,omitempty"`
	// specifies host network mode of service
	HostNetwork bool `json:"hostNetwork,omitempty" yaml:"hostNetwork,omitempty"`
	// specifies function config of service
	FunctionConfig *ServiceFunctionConfig `json:"functionConfig,omitempty" yaml:"functionConfig,omitempty"`
	// specifies functions of service
	Functions []ServiceFunction `json:"functions,omitempty" yaml:"functions,omitempty"`
	// specifies type of service. deployment, daemonset, statefulset
	Type string `json:"type,omitempty" yaml:"type,omitempty" default:"deployment"`
}

Service service config1ma1

type ServiceFunction

type ServiceFunction struct {
	Name    string `json:"name,omitempty" yaml:"name,omitempty"`
	Handler string `json:"handler,omitempty" yaml:"handler,omitempty"`
	CodeDir string `json:"codedir,omitempty" yaml:"codedir,omitempty"`
}

type ServiceFunctionConfig

type ServiceFunctionConfig struct {
	Name    string `json:"name,omitempty" yaml:"name,omitempty" validate:"resourceName"`
	Runtime string `json:"runtime,omitempty" yaml:"runtime,omitempty"`
}

type Status

type Status string
const (
	Pending Status = "Pending"
	Failed  Status = "Failed"
	Running Status = "Running"
	Unknown Status = "Unknown"
)

type SyncMode added in v2.0.66

type SyncMode string

type Volume

type Volume struct {
	// specified name of the volume
	Name string `json:"name,omitempty" yaml:"name,omitempty" binding:"required" validate:"resourceName"`
	// specified driver for the storage volume
	VolumeSource `json:",inline" yaml:",inline"`
}

Volume volume config

type VolumeMount

type VolumeMount struct {
	// specifies name of volume
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// specifies mount path of volume
	MountPath string `json:"mountPath,omitempty" yaml:"mountPath,omitempty"`
	// specifies if the volume is read-only
	ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
	// specifies if the volumeMount is immutable
	Immutable bool `json:"immutable,omitempty" yaml:"immutable,omitempty"`
}

VolumeMount volume mount config

type VolumeSource

type VolumeSource struct {
	HostPath *HostPathVolumeSource `json:"hostPath,omitempty" yaml:"hostPath,omitempty"`
	Config   *ObjectReference      `json:"config,omitempty" yaml:"config,omitempty"`
	Secret   *ObjectReference      `json:"secret,omitempty" yaml:"secret,omitempty"`
}

VolumeSource volume source, include empty directory, host path, config and secret

Jump to

Keyboard shortcuts

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