v1beta2

package
v0.0.0-...-814ced4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1beta2 is the second version of the stack, containing a structured spec

Index

Constants

View Source
const GroupName = "compose.docker.com"

GroupName is the name of the compose group

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"}
	// SchemeBuilder is the scheme builder
	SchemeBuilder runtime.SchemeBuilder

	// AddToScheme adds to scheme
	AddToScheme = localSchemeBuilder.AddToScheme
)

Functions

func GroupResource

func GroupResource(resource string) schema.GroupResource

GroupResource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ComposeFile

type ComposeFile struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	ComposeFile       string `json:"composeFile,omitempty"`
}

ComposeFile is the content of a stack's compose file if any

func (*ComposeFile) DeepCopyObject

func (c *ComposeFile) DeepCopyObject() runtime.Object

DeepCopyObject clones the ComposeFile

type ConfigObjConfig

type ConfigObjConfig FileObjectConfig

ConfigObjConfig is the config for the swarm "Config" object

type Constraint

type Constraint struct {
	Value    string
	Operator string
}

Constraint defines a constraint and it's operator (== or !=)

type Constraints

type Constraints struct {
	OperatingSystem *Constraint
	Architecture    *Constraint
	Hostname        *Constraint
	MatchLabels     map[string]Constraint
}

Constraints lists constraints that can be set on the service

type DeployConfig

type DeployConfig struct {
	Mode          string            `json:"mode,omitempty"`
	Replicas      *uint64           `json:"replicas,omitempty"`
	Labels        map[string]string `json:"labels,omitempty"`
	UpdateConfig  *UpdateConfig     `json:"update_config,omitempty"`
	Resources     Resources         `json:"resources,omitempty"`
	RestartPolicy *RestartPolicy    `json:"restart_policy,omitempty"`
	Placement     Placement         `json:"placement,omitempty"`
}

DeployConfig is the deployment configuration for a service

type External

type External struct {
	Name     string `json:"name,omitempty"`
	External bool   `json:"external,omitempty"`
}

External identifies a Volume or Network as a reference to a resource that is not managed, and should already exist. External.name is deprecated and replaced by Volume.name

type FileObjectConfig

type FileObjectConfig struct {
	Name     string            `json:"name,omitempty"`
	File     string            `json:"file,omitempty"`
	External External          `json:"external,omitempty"`
	Labels   map[string]string `json:"labels,omitempty"`
}

FileObjectConfig is a config type for a file used by a service

type FileReferenceConfig

type FileReferenceConfig struct {
	Source string  `json:"source,omitempty"`
	Target string  `json:"target,omitempty"`
	UID    string  `json:"uid,omitempty"`
	GID    string  `json:"gid,omitempty"`
	Mode   *uint32 `json:"mode,omitempty"`
}

FileReferenceConfig for a reference to a swarm file object

type HealthCheckConfig

type HealthCheckConfig struct {
	Test     []string       `json:"test,omitempty"`
	Timeout  *time.Duration `json:"timeout,omitempty"`
	Interval *time.Duration `json:"interval,omitempty"`
	Retries  *uint64        `json:"retries,omitempty"`
}

HealthCheckConfig the healthcheck configuration for a service

type Owner

type Owner struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Owner             impersonation.Config `json:"owner,omitempty"`
}

Owner describes the user who created the stack

func (*Owner) DeepCopyObject

func (o *Owner) DeepCopyObject() runtime.Object

DeepCopyObject clones the owner

type Placement

type Placement struct {
	Constraints *Constraints `json:"constraints,omitempty"`
}

Placement constraints for the service

type Resource

type Resource struct {
	NanoCPUs    string `json:"cpus,omitempty"`
	MemoryBytes int64  `json:"memory,omitempty"`
}

Resource is a resource to be limited or reserved

type Resources

type Resources struct {
	Limits       *Resource `json:"limits,omitempty"`
	Reservations *Resource `json:"reservations,omitempty"`
}

Resources the resource limits and reservations

type RestartPolicy

type RestartPolicy struct {
	Condition string `json:"condition,omitempty"`
}

RestartPolicy is the service restart policy

type Scale

type Scale struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              map[string]int `json:"spec,omitempty"`
	Status            map[string]int `json:"status,omitempty"`
}

Scale contains the current/desired replica count for services in a stack.

func (*Scale) DeepCopyObject

func (s *Scale) DeepCopyObject() runtime.Object

DeepCopyObject clones the scale

type SecretConfig

type SecretConfig FileObjectConfig

SecretConfig for a secret

type ServiceConfig

type ServiceConfig struct {
	Name string `json:"name,omitempty"`

	CapAdd          []string                 `json:"cap_add,omitempty"`
	CapDrop         []string                 `json:"cap_drop,omitempty"`
	Command         []string                 `json:"command,omitempty"`
	Configs         []ServiceConfigObjConfig `json:"configs,omitempty"`
	Deploy          DeployConfig             `json:"deploy,omitempty"`
	Entrypoint      []string                 `json:"entrypoint,omitempty"`
	Environment     map[string]*string       `json:"environment,omitempty"`
	ExtraHosts      []string                 `json:"extra_hosts,omitempty"`
	Hostname        string                   `json:"hostname,omitempty"`
	HealthCheck     *HealthCheckConfig       `json:"health_check,omitempty"`
	Image           string                   `json:"image,omitempty"`
	Ipc             string                   `json:"ipc,omitempty"`
	Labels          map[string]string        `json:"labels,omitempty"`
	Pid             string                   `json:"pid,omitempty"`
	Ports           []ServicePortConfig      `json:"ports,omitempty"`
	Privileged      bool                     `json:"privileged,omitempty"`
	ReadOnly        bool                     `json:"read_only,omitempty"`
	Secrets         []ServiceSecretConfig    `json:"secrets,omitempty"`
	StdinOpen       bool                     `json:"stdin_open,omitempty"`
	StopGracePeriod *time.Duration           `json:"stop_grace_period,omitempty"`
	Tmpfs           []string                 `json:"tmpfs,omitempty"`
	Tty             bool                     `json:"tty,omitempty"`
	User            *int64                   `json:"user,omitempty"`
	Volumes         []ServiceVolumeConfig    `json:"volumes,omitempty"`
	WorkingDir      string                   `json:"working_dir,omitempty"`
}

ServiceConfig is the configuration of one service

type ServiceConfigObjConfig

type ServiceConfigObjConfig FileReferenceConfig

ServiceConfigObjConfig is the config obj configuration for a service

type ServicePortConfig

type ServicePortConfig struct {
	Mode      string `json:"mode,omitempty"`
	Target    uint32 `json:"target,omitempty"`
	Published uint32 `json:"published,omitempty"`
	Protocol  string `json:"protocol,omitempty"`
}

ServicePortConfig is the port configuration for a service

type ServiceSecretConfig

type ServiceSecretConfig FileReferenceConfig

ServiceSecretConfig is the secret configuration for a service

type ServiceVolumeConfig

type ServiceVolumeConfig struct {
	Type     string `json:"type,omitempty"`
	Source   string `json:"source,omitempty"`
	Target   string `json:"target,omitempty"`
	ReadOnly bool   `json:"read_only,omitempty"`
}

ServiceVolumeConfig are references to a volume used by a service

type Stack

type Stack struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   *StackSpec   `json:"spec,omitempty"`
	Status *StackStatus `json:"status,omitempty"`
}

Stack is v1beta2's representation of a Stack

func (*Stack) Clone

func (s *Stack) Clone() *Stack

Clone clones a Stack

func (*Stack) DeepCopyObject

func (s *Stack) DeepCopyObject() runtime.Object

DeepCopyObject clones the stack

type StackList

type StackList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	Items []Stack `json:"items" protobuf:"bytes,2,rep,name=items"`
}

StackList is a list of stacks

func (*StackList) DeepCopyObject

func (s *StackList) DeepCopyObject() runtime.Object

DeepCopyObject clones the stack list

type StackPhase

type StackPhase string

StackPhase is the deployment phase of a stack

const (
	// StackAvailable means the stack is available.
	StackAvailable StackPhase = "Available"
	// StackProgressing means the deployment is progressing.
	StackProgressing StackPhase = "Progressing"
	// StackFailure is added in a stack when one of its members fails to be created
	// or deleted.
	StackFailure StackPhase = "Failure"
)

These are valid conditions of a stack.

type StackSpec

type StackSpec struct {
	Services []ServiceConfig            `json:"services,omitempty"`
	Secrets  map[string]SecretConfig    `json:"secrets,omitempty"`
	Configs  map[string]ConfigObjConfig `json:"configs,omitempty"`
}

StackSpec defines the desired state of Stack

type StackStatus

type StackStatus struct {
	// Current condition of the stack.
	// +optional
	Phase StackPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=StackPhase"`
	// A human readable message indicating details about the stack.
	// +optional
	Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
}

StackStatus defines the observed state of Stack

type UpdateConfig

type UpdateConfig struct {
	Parallelism *uint64 `json:"paralellism,omitempty"`
}

UpdateConfig is the service update configuration

Jump to

Keyboard shortcuts

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