swarm
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Constants
- type Annotations
- type AppArmorMode
- type AppArmorOpts
- type CAConfig
- type ClusterInfo
- type Config
- type ConfigCreateResponse
- type ConfigReference
- type ConfigReferenceFileTarget
- type ConfigReferenceRuntimeTarget
- type ConfigSpec
- type ContainerSpec
- type ContainerStatus
- type CredentialSpec
- type DNSConfig
- type DiscreteGenericResource
- type DispatcherConfig
- type Driver
- type EncryptionConfig
- type Endpoint
- type EndpointSpec
- type EndpointVirtualIP
- type EngineDescription
- type ExternalCA
- type ExternalCAProtocol
- type FailureAction
- type GenericResource
- type GlobalJob
- type GlobalService
- type IPAMConfig
- type IPAMOptions
- type Info
- type InitRequest
- type JobStatus
- type JoinRequest
- type JoinTokens
- type Limit
- type LocalNodeState
- type ManagerStatus
- type Meta
- type NamedGenericResource
- type Network
- type NetworkAttachment
- type NetworkAttachmentConfig
- type NetworkAttachmentSpec
- type NetworkSpec
- type Node
- type NodeAvailability
- type NodeCSIInfo
- type NodeDescription
- type NodeRole
- type NodeSpec
- type NodeState
- type NodeStatus
- type OrchestrationConfig
- type Peer
- type Placement
- type PlacementPreference
- type Platform
- type PluginDescription
- type PortConfig
- type PortConfigPublishMode
- type PortStatus
- type Privileges
- type RaftConfig
- type Reachability
- type RegistryAuthSource
- type ReplicatedJob
- type ReplicatedService
- type ResolutionMode
- type ResourceRequirements
- type Resources
- type RestartPolicy
- type RestartPolicyCondition
- type RuntimePrivilege
- type RuntimeSpec
- type RuntimeType
- type RuntimeURL
- type SELinuxContext
- type SeccompMode
- type SeccompOpts
- type Secret
- type SecretCreateResponse
- type SecretReference
- type SecretReferenceFileTarget
- type SecretSpec
- type Service
- type ServiceCreateResponse
- type ServiceMode
- type ServiceSpec
- type ServiceStatus
- type ServiceUpdateResponse
- type Spec
- type SpreadOver
- type Swarm
- type TLSInfo
- type Task
- type TaskDefaults
- type TaskSpec
- type TaskState
- type TaskStatus
- type Topology
- type UnlockKeyResponse
- type UnlockRequest
- type UpdateConfig
- type UpdateOrder
- type UpdateState
- type UpdateStatus
- type Version
- type VolumeAttachment
Constants¶
const (// RuntimeContainer is the container based runtimeRuntimeContainerRuntimeType = "container"// RuntimePlugin is the plugin based runtimeRuntimePluginRuntimeType = "plugin"// RuntimeNetworkAttachment is the network attachment runtimeRuntimeNetworkAttachmentRuntimeType = "attachment"// RuntimeURLContainer is the proto url for the container typeRuntimeURLContainerRuntimeURL = "types.docker.com/RuntimeContainer"// RuntimeURLPlugin is the proto url for the plugin typeRuntimeURLPluginRuntimeURL = "types.docker.com/RuntimePlugin")
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeAnnotations¶
Annotations represents how to describe an object.
typeAppArmorMode¶
type AppArmorModestring
AppArmorMode is type used for the enumeration of possible AppArmor modes inAppArmorOpts
const (AppArmorModeDefaultAppArmorMode = "default"AppArmorModeDisabledAppArmorMode = "disabled")
typeAppArmorOpts¶
type AppArmorOpts struct {ModeAppArmorMode `json:",omitempty"`}AppArmorOpts defines the options for configuring AppArmor on a swarm-managedcontainer. Currently, custom AppArmor profiles are not supported.
typeCAConfig¶
type CAConfig struct {// NodeCertExpiry is the duration certificates should be issued forNodeCertExpirytime.Duration `json:",omitempty"`// ExternalCAs is a list of CAs to which a manager node will make// certificate signing requests for node certificates.ExternalCAs []*ExternalCA `json:",omitempty"`// SigningCACert and SigningCAKey specify the desired signing root CA and// root CA key for the swarm. When inspecting the cluster, the key will// be redacted.SigningCACertstring `json:",omitempty"`SigningCAKeystring `json:",omitempty"`// If this value changes, and there is no specified signing cert and key,// then the swarm is forced to generate a new root certificate and key.ForceRotateuint64 `json:",omitempty"`}CAConfig represents CA configuration.
typeClusterInfo¶
type ClusterInfo struct {IDstringMetaSpecSpecTLSInfoTLSInfoRootRotationInProgressboolDefaultAddrPool []netip.PrefixSubnetSizeuint32DataPathPortuint32}ClusterInfo represents info about the cluster for outputting in "info"it contains the same information as "Swarm", but without the JoinTokens
typeConfigCreateResponse¶
type ConfigCreateResponse struct {// ID is the id of the created config.IDstring}ConfigCreateResponse contains the information returned to a clienton the creation of a new config.
typeConfigReference¶
type ConfigReference struct {File *ConfigReferenceFileTarget `json:",omitempty"`Runtime *ConfigReferenceRuntimeTarget `json:",omitempty"`ConfigIDstringConfigNamestring}ConfigReference is a reference to a config in swarm
typeConfigReferenceFileTarget¶
ConfigReferenceFileTarget is a file target in a config reference
typeConfigReferenceRuntimeTarget¶
type ConfigReferenceRuntimeTarget struct{}ConfigReferenceRuntimeTarget is a target for a config specifying that itisn't mounted into the container but instead has some other purpose.
typeConfigSpec¶
type ConfigSpec struct {Annotations// Data is the data to store as a config.//// The maximum allowed size is 1000KB, as defined in [MaxConfigSize].//// [MaxConfigSize]:https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSizeData []byte `json:",omitempty"`// Templating controls whether and how to evaluate the config payload as// a template. If it is not set, no templating is used.Templating *Driver `json:",omitempty"`}ConfigSpec represents a config specification from a config in swarm
typeContainerSpec¶
type ContainerSpec struct {Imagestring `json:",omitempty"`Labels map[string]string `json:",omitempty"`Command []string `json:",omitempty"`Args []string `json:",omitempty"`Hostnamestring `json:",omitempty"`Env []string `json:",omitempty"`Dirstring `json:",omitempty"`Userstring `json:",omitempty"`Groups []string `json:",omitempty"`Privileges *Privileges `json:",omitempty"`Init *bool `json:",omitempty"`StopSignalstring `json:",omitempty"`TTYbool `json:",omitempty"`OpenStdinbool `json:",omitempty"`ReadOnlybool `json:",omitempty"`Mounts []mount.Mount `json:",omitempty"`StopGracePeriod *time.Duration `json:",omitempty"`Healthcheck *container.HealthConfig `json:",omitempty"`// The format of extra hosts on swarmkit is specified in://http://man7.org/linux/man-pages/man5/hosts.5.html// IP_address canonical_hostname [aliases...]Hosts []string `json:",omitempty"`DNSConfig *DNSConfig `json:",omitempty"`Secrets []*SecretReference `json:",omitempty"`Configs []*ConfigReference `json:",omitempty"`Isolationcontainer.Isolation `json:",omitempty"`Sysctls map[string]string `json:",omitempty"`CapabilityAdd []string `json:",omitempty"`CapabilityDrop []string `json:",omitempty"`Ulimits []*container.Ulimit `json:",omitempty"`OomScoreAdjint64 `json:",omitempty"`}ContainerSpec represents the spec of a container.
typeContainerStatus¶
ContainerStatus represents the status of a container.
typeCredentialSpec¶
CredentialSpec for managed service account (Windows only)
typeDNSConfig¶
type DNSConfig struct {// Nameservers specifies the IP addresses of the name serversNameservers []netip.Addr `json:",omitempty"`// Search specifies the search list for host-name lookupSearch []string `json:",omitempty"`// Options allows certain internal resolver variables to be modifiedOptions []string `json:",omitempty"`}DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf)Detailed documentation is available in:http://man7.org/linux/man-pages/man5/resolv.conf.5.html`nameserver`, `search`, `options` have been supported.TODO: `domain` is not supported yet.
typeDiscreteGenericResource¶
DiscreteGenericResource represents a "user defined" resource which is definedas an integer"Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...)Value is used to count the resource (SSD=5, HDD=3, ...)
typeDispatcherConfig¶
type DispatcherConfig struct {// HeartbeatPeriod defines how often agent should send heartbeats to// dispatcher.HeartbeatPeriodtime.Duration `json:",omitempty"`}DispatcherConfig represents dispatcher configuration.
typeEncryptionConfig¶
type EncryptionConfig struct {// AutoLockManagers specifies whether or not managers TLS keys and raft data// should be encrypted at rest in such a way that they must be unlocked// before the manager node starts up again.AutoLockManagersbool}EncryptionConfig controls at-rest encryption of data and keys.
typeEndpoint¶
type Endpoint struct {SpecEndpointSpec `json:",omitempty"`Ports []PortConfig `json:",omitempty"`VirtualIPs []EndpointVirtualIP `json:",omitempty"`}Endpoint represents an endpoint.
typeEndpointSpec¶
type EndpointSpec struct {ModeResolutionMode `json:",omitempty"`Ports []PortConfig `json:",omitempty"`}EndpointSpec represents the spec of an endpoint.
typeEndpointVirtualIP¶
type EndpointVirtualIP struct {NetworkIDstring `json:",omitempty"`// Addr is the virtual ip address.// This field accepts CIDR notation, for example `10.0.0.1/24`, to maintain backwards// compatibility, but only the IP address is used.Addrnetip.Prefix `json:",omitempty"`}EndpointVirtualIP represents the virtual ip of a port.
typeEngineDescription¶
type EngineDescription struct {EngineVersionstring `json:",omitempty"`Labels map[string]string `json:",omitempty"`Plugins []PluginDescription `json:",omitempty"`}EngineDescription represents the description of an engine.
typeExternalCA¶
type ExternalCA struct {// Protocol is the protocol used by this external CA.ProtocolExternalCAProtocol// URL is the URL where the external CA can be reached.URLstring// Options is a set of additional key/value pairs whose interpretation// depends on the specified CA type.Options map[string]string `json:",omitempty"`// CACert specifies which root CA is used by this external CA. This certificate must// be in PEM format.CACertstring}ExternalCA defines external CA to be used by the cluster.
typeExternalCAProtocol¶
type ExternalCAProtocolstring
ExternalCAProtocol represents type of external CA.
const ExternalCAProtocolCFSSLExternalCAProtocol = "cfssl"ExternalCAProtocolCFSSL CFSSL
typeFailureAction¶
type FailureActionstring
FailureAction is the action to perform when updating a service fails.
const (// UpdateFailureActionPause PAUSEUpdateFailureActionPauseFailureAction = "pause"// UpdateFailureActionContinue CONTINUEUpdateFailureActionContinueFailureAction = "continue"// UpdateFailureActionRollback ROLLBACKUpdateFailureActionRollbackFailureAction = "rollback")
typeGenericResource¶
type GenericResource struct {NamedResourceSpec *NamedGenericResource `json:",omitempty"`DiscreteResourceSpec *DiscreteGenericResource `json:",omitempty"`}GenericResource represents a "user defined" resource which canbe either an integer (e.g: SSD=3) or a string (e.g: SSD=sda1)
typeGlobalJob¶
type GlobalJob struct{}GlobalJob is the type of a Service which executes a Task on every Nodematching the Service's placement constraints. These tasks run to completionand then exit.
This type is deliberately empty.
typeIPAMConfig¶
type IPAMConfig struct {Subnetnetip.Prefix `json:",omitempty"`Rangenetip.Prefix `json:",omitempty"`Gatewaynetip.Addr `json:",omitempty"`}IPAMConfig represents ipam configuration.
typeIPAMOptions¶
type IPAMOptions struct {DriverDriver `json:",omitempty"`Configs []IPAMConfig `json:",omitempty"`}IPAMOptions represents ipam options.
typeInfo¶
type Info struct {NodeIDstringNodeAddrstringLocalNodeStateLocalNodeStateControlAvailableboolErrorstringRemoteManagers []PeerNodesint `json:",omitempty"`Managersint `json:",omitempty"`Cluster *ClusterInfo `json:",omitempty"`Warnings []string `json:",omitempty"`}Info represents generic information about swarm.
typeInitRequest¶
type InitRequest struct {ListenAddrstringAdvertiseAddrstringDataPathAddrstringDataPathPortuint32ForceNewClusterboolSpecSpecAutoLockManagersboolAvailabilityNodeAvailabilityDefaultAddrPool []netip.PrefixSubnetSizeuint32}InitRequest is the request used to init a swarm.
typeJobStatus¶
type JobStatus struct {// JobIteration is a value increased each time a Job is executed,// successfully or otherwise. "Executed", in this case, means the job as a// whole has been started, not that an individual Task has been launched. A// job is "Executed" when its ServiceSpec is updated. JobIteration can be// used to disambiguate Tasks belonging to different executions of a job.//// Though JobIteration will increase with each subsequent execution, it may// not necessarily increase by 1, and so JobIteration should not be used to// keep track of the number of times a job has been executed.JobIterationVersion// LastExecution is the time that the job was last executed, as observed by// Swarm manager.LastExecutiontime.Time `json:",omitempty"`}JobStatus is the status of a job-type service.
typeJoinRequest¶
type JoinRequest struct {ListenAddrstringAdvertiseAddrstringDataPathAddrstringRemoteAddrs []stringJoinTokenstring// accept by secretAvailabilityNodeAvailability}JoinRequest is the request used to join a swarm.
typeJoinTokens¶
type JoinTokens struct {// Worker is the join token workers may use to join the swarm.Workerstring// Manager is the join token managers may use to join the swarm.Managerstring}JoinTokens contains the tokens workers and managers need to join the swarm.
typeLimit¶
type Limit struct {NanoCPUsint64 `json:",omitempty"`MemoryBytesint64 `json:",omitempty"`Pidsint64 `json:",omitempty"`}Limit describes limits on resources which can be requested by a task.
typeLocalNodeState¶
type LocalNodeStatestring
LocalNodeState represents the state of the local node.
const (// LocalNodeStateInactive INACTIVELocalNodeStateInactiveLocalNodeState = "inactive"// LocalNodeStatePending PENDINGLocalNodeStatePendingLocalNodeState = "pending"// LocalNodeStateActive ACTIVELocalNodeStateActiveLocalNodeState = "active"// LocalNodeStateError ERRORLocalNodeStateErrorLocalNodeState = "error"// LocalNodeStateLocked LOCKEDLocalNodeStateLockedLocalNodeState = "locked")
typeManagerStatus¶
type ManagerStatus struct {Leaderbool `json:",omitempty"`ReachabilityReachability `json:",omitempty"`Addrstring `json:",omitempty"`}ManagerStatus represents the status of a manager.
typeMeta¶
type Meta struct {VersionVersion `json:",omitempty"`CreatedAttime.Time `json:",omitempty"`UpdatedAttime.Time `json:",omitempty"`}Meta is a base object inherited by most of the other once.
typeNamedGenericResource¶
NamedGenericResource represents a "user defined" resource which is definedas a string."Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...)Value is used to identify the resource (GPU="UUID-1", FPGA="/dev/sdb5", ...)
typeNetwork¶
type Network struct {IDstringMetaSpecNetworkSpec `json:",omitempty"`DriverStateDriver `json:",omitempty"`IPAMOptions *IPAMOptions `json:",omitempty"`}Network represents a network.
typeNetworkAttachment¶
type NetworkAttachment struct {NetworkNetwork `json:",omitempty"`// Addresses contains the IP addresses associated with the endpoint in the network.// This field accepts CIDR notation, for example `10.0.0.1/24`, to maintain backwards// compatibility, but only the IP address is used.Addresses []netip.Prefix `json:",omitempty"`}NetworkAttachment represents a network attachment.
typeNetworkAttachmentConfig¶
type NetworkAttachmentConfig struct {Targetstring `json:",omitempty"`Aliases []string `json:",omitempty"`DriverOpts map[string]string `json:",omitempty"`}NetworkAttachmentConfig represents the configuration of a network attachment.
typeNetworkAttachmentSpec¶
type NetworkAttachmentSpec struct {ContainerIDstring}NetworkAttachmentSpec represents the runtime spec type for networkattachment tasks
typeNetworkSpec¶
type NetworkSpec struct {AnnotationsDriverConfiguration *Driver `json:",omitempty"`IPv6Enabledbool `json:",omitempty"`Internalbool `json:",omitempty"`Attachablebool `json:",omitempty"`Ingressbool `json:",omitempty"`IPAMOptions *IPAMOptions `json:",omitempty"`ConfigFrom *network.ConfigReference `json:",omitempty"`Scopestring `json:",omitempty"`}NetworkSpec represents the spec of a network.
typeNode¶
type Node struct {IDstringMeta// Spec defines the desired state of the node as specified by the user.// The system will honor this and will *never* modify it.SpecNodeSpec `json:",omitempty"`// Description encapsulates the properties of the Node as reported by the// agent.DescriptionNodeDescription `json:",omitempty"`// Status provides the current status of the node, as seen by the manager.StatusNodeStatus `json:",omitempty"`// ManagerStatus provides the current status of the node's manager// component, if the node is a manager.ManagerStatus *ManagerStatus `json:",omitempty"`}Node represents a node.
typeNodeAvailability¶
type NodeAvailabilitystring
NodeAvailability represents the availability of a node.
const (// NodeAvailabilityActive ACTIVENodeAvailabilityActiveNodeAvailability = "active"// NodeAvailabilityPause PAUSENodeAvailabilityPauseNodeAvailability = "pause"// NodeAvailabilityDrain DRAINNodeAvailabilityDrainNodeAvailability = "drain")
typeNodeCSIInfo¶
type NodeCSIInfo struct {// PluginName is the name of the CSI plugin.PluginNamestring `json:",omitempty"`// NodeID is the ID of the node as reported by the CSI plugin. This is// different from the swarm node ID.NodeIDstring `json:",omitempty"`// MaxVolumesPerNode is the maximum number of volumes that may be published// to this nodeMaxVolumesPerNodeint64 `json:",omitempty"`// AccessibleTopology indicates the location of this node in the CSI// plugin's topologyAccessibleTopology *Topology `json:",omitempty"`}NodeCSIInfo represents information about a CSI plugin available on the node
typeNodeDescription¶
type NodeDescription struct {Hostnamestring `json:",omitempty"`PlatformPlatform `json:",omitempty"`ResourcesResources `json:",omitempty"`EngineEngineDescription `json:",omitempty"`TLSInfoTLSInfo `json:",omitempty"`CSIInfo []NodeCSIInfo `json:",omitempty"`}NodeDescription represents the description of a node.
typeNodeSpec¶
type NodeSpec struct {AnnotationsRoleNodeRole `json:",omitempty"`AvailabilityNodeAvailability `json:",omitempty"`}NodeSpec represents the spec of a node.
typeNodeStatus¶
type NodeStatus struct {StateNodeState `json:",omitempty"`Messagestring `json:",omitempty"`Addrstring `json:",omitempty"`}NodeStatus represents the status of a node.
typeOrchestrationConfig¶
type OrchestrationConfig struct {// TaskHistoryRetentionLimit is the number of historic tasks to keep per instance or// node. If negative, never remove completed or failed tasks.TaskHistoryRetentionLimit *int64 `json:",omitempty"`}OrchestrationConfig represents orchestration configuration.
typePlacement¶
type Placement struct {Constraints []string `json:",omitempty"`Preferences []PlacementPreference `json:",omitempty"`MaxReplicasuint64 `json:",omitempty"`// Platforms stores all the platforms that the image can run on.// This field is used in the platform filter for scheduling. If empty,// then the platform filter is off, meaning there are no scheduling restrictions.Platforms []Platform `json:",omitempty"`}Placement represents orchestration parameters.
typePlacementPreference¶
type PlacementPreference struct {Spread *SpreadOver}PlacementPreference provides a way to make the scheduler aware of factorssuch as topology.
typePluginDescription¶
PluginDescription represents the description of an engine plugin.
typePortConfig¶
type PortConfig struct {Namestring `json:",omitempty"`Protocolnetwork.IPProtocol `json:",omitempty"`// TargetPort is the port inside the containerTargetPortuint32 `json:",omitempty"`// PublishedPort is the port on the swarm hostsPublishedPortuint32 `json:",omitempty"`// PublishMode is the mode in which port is publishedPublishModePortConfigPublishMode `json:",omitempty"`}PortConfig represents the config of a port.
typePortConfigPublishMode¶
type PortConfigPublishModestring
PortConfigPublishMode represents the mode in which the port is tobe published.
const (// PortConfigPublishModeIngress is used for ports published// for ingress load balancing using routing mesh.PortConfigPublishModeIngressPortConfigPublishMode = "ingress"// PortConfigPublishModeHost is used for ports published// for direct host level access on the host where the task is running.PortConfigPublishModeHostPortConfigPublishMode = "host")
typePortStatus¶
type PortStatus struct {Ports []PortConfig `json:",omitempty"`}PortStatus represents the port status of a task's host ports whoseservice has published host ports
typePrivileges¶
type Privileges struct {CredentialSpec *CredentialSpecSELinuxContext *SELinuxContextSeccomp *SeccompOpts `json:",omitempty"`AppArmor *AppArmorOpts `json:",omitempty"`NoNewPrivilegesbool}Privileges defines the security options for the container.
typeRaftConfig¶
type RaftConfig struct {// SnapshotInterval is the number of log entries between snapshots.SnapshotIntervaluint64 `json:",omitempty"`// KeepOldSnapshots is the number of snapshots to keep beyond the// current snapshot.KeepOldSnapshots *uint64 `json:",omitempty"`// LogEntriesForSlowFollowers is the number of log entries to keep// around to sync up slow followers after a snapshot is created.LogEntriesForSlowFollowersuint64 `json:",omitempty"`// ElectionTick is the number of ticks that a follower will wait for a message// from the leader before becoming a candidate and starting an election.// ElectionTick must be greater than HeartbeatTick.//// A tick currently defaults to one second, so these translate directly to// seconds currently, but this is NOT guaranteed.ElectionTickint// HeartbeatTick is the number of ticks between heartbeats. Every// HeartbeatTick ticks, the leader will send a heartbeat to the// followers.//// A tick currently defaults to one second, so these translate directly to// seconds currently, but this is NOT guaranteed.HeartbeatTickint}RaftConfig represents raft configuration.
typeReachability¶
type Reachabilitystring
Reachability represents the reachability of a node.
const (// ReachabilityUnknown UNKNOWNReachabilityUnknownReachability = "unknown"// ReachabilityUnreachable UNREACHABLEReachabilityUnreachableReachability = "unreachable"// ReachabilityReachable REACHABLEReachabilityReachableReachability = "reachable")
typeRegistryAuthSource¶
type RegistryAuthSourcestring
RegistryAuthSource defines options for the "registryAuthFrom" query parameteron service update.
const (RegistryAuthFromSpecRegistryAuthSource = "spec"RegistryAuthFromPreviousSpecRegistryAuthSource = "previous-spec")
Values for RegistryAuthFrom in ServiceUpdateOptions
typeReplicatedJob¶
type ReplicatedJob struct {// MaxConcurrent indicates the maximum number of Tasks that should be// executing simultaneously for this job at any given time. There may be// fewer Tasks that MaxConcurrent executing simultaneously; for example, if// there are fewer than MaxConcurrent tasks needed to reach// TotalCompletions.//// If this field is empty, it will default to a max concurrency of 1.MaxConcurrent *uint64 `json:",omitempty"`// TotalCompletions is the total number of Tasks desired to run to// completion.//// If this field is empty, the value of MaxConcurrent will be used.TotalCompletions *uint64 `json:",omitempty"`}ReplicatedJob is the a type of Service which executes a defined Tasksin parallel until the specified number of Tasks have succeeded.
typeReplicatedService¶
type ReplicatedService struct {Replicas *uint64 `json:",omitempty"`}ReplicatedService is a kind of ServiceMode.
typeResolutionMode¶
type ResolutionModestring
ResolutionMode represents a resolution mode.
const (// ResolutionModeVIP VIPResolutionModeVIPResolutionMode = "vip"// ResolutionModeDNSRR DNSRRResolutionModeDNSRRResolutionMode = "dnsrr")
typeResourceRequirements¶
type ResourceRequirements struct {Limits *Limit `json:",omitempty"`Reservations *Resources `json:",omitempty"`// Amount of swap in bytes - can only be used together with a memory limit// -1 means unlimited// a null pointer keeps the default behaviour of granting twice the memory// amount in swapSwapBytes *int64 `json:"SwapBytes,omitzero"`// Tune container memory swappiness (0 to 100) - if not specified, defaults// to the container OS's default - generally 60, or the value predefined in// the image; set to -1 to unset a previously set valueMemorySwappiness *int64 `json:MemorySwappiness,omitzero"`}ResourceRequirements represents resources requirements.
typeResources¶
type Resources struct {NanoCPUsint64 `json:",omitempty"`MemoryBytesint64 `json:",omitempty"`GenericResources []GenericResource `json:",omitempty"`}Resources represents resources (CPU/Memory) which can be advertised by anode and requested to be reserved for a task.
typeRestartPolicy¶
type RestartPolicy struct {ConditionRestartPolicyCondition `json:",omitempty"`Delay *time.Duration `json:",omitempty"`MaxAttempts *uint64 `json:",omitempty"`Window *time.Duration `json:",omitempty"`}RestartPolicy represents the restart policy.
typeRestartPolicyCondition¶
type RestartPolicyConditionstring
RestartPolicyCondition represents when to restart.
const (// RestartPolicyConditionNone NONERestartPolicyConditionNoneRestartPolicyCondition = "none"// RestartPolicyConditionOnFailure ON_FAILURERestartPolicyConditionOnFailureRestartPolicyCondition = "on-failure"// RestartPolicyConditionAny ANYRestartPolicyConditionAnyRestartPolicyCondition = "any")
typeRuntimePrivilege¶
type RuntimePrivilege struct {Namestring `json:"name,omitempty"`Descriptionstring `json:"description,omitempty"`Value []string `json:"value,omitempty"`}RuntimePrivilege describes a permission the user has to acceptupon installing a plugin.
typeRuntimeSpec¶
type RuntimeSpec struct {Namestring `json:"name,omitempty"`Remotestring `json:"remote,omitempty"`Privileges []*RuntimePrivilege `json:"privileges,omitempty"`Disabledbool `json:"disabled,omitempty"`Env []string `json:"env,omitempty"`}RuntimeSpec defines the base payload which clients can specify for creatinga service with the plugin runtime.
typeSELinuxContext¶
SELinuxContext contains the SELinux labels of the container.
typeSeccompMode¶
type SeccompModestring
SeccompMode is the type used for the enumeration of possible seccomp modesin SeccompOpts
const (SeccompModeDefaultSeccompMode = "default"SeccompModeUnconfinedSeccompMode = "unconfined"SeccompModeCustomSeccompMode = "custom")
typeSeccompOpts¶
type SeccompOpts struct {// Mode is the SeccompMode used for the container.ModeSeccompMode `json:",omitempty"`// Profile is the custom seccomp profile as a json object to be used with// the container. Mode should be set to SeccompModeCustom when using a// custom profile in this manner.Profile []byte `json:",omitempty"`}SeccompOpts defines the options for configuring seccomp on a swarm-managedcontainer.
typeSecretCreateResponse¶
type SecretCreateResponse struct {// ID is the id of the created secret.IDstring}SecretCreateResponse contains the information returned to a clienton the creation of a new secret.
typeSecretReference¶
type SecretReference struct {File *SecretReferenceFileTargetSecretIDstringSecretNamestring}SecretReference is a reference to a secret in swarm
typeSecretReferenceFileTarget¶
SecretReferenceFileTarget is a file target in a secret reference
typeSecretSpec¶
type SecretSpec struct {Annotations// Data is the data to store as a secret. It must be empty if a// [Driver] is used, in which case the data is loaded from an external// secret store. The maximum allowed size is 500KB, as defined in// [MaxSecretSize].//// This field is only used to create the secret, and is not returned// by other endpoints.//// [MaxSecretSize]:https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSizeData []byte `json:",omitempty"`// Driver is the name of the secrets driver used to fetch the secret's// value from an external secret store. If not set, the default built-in// store is used.Driver *Driver `json:",omitempty"`// Templating controls whether and how to evaluate the secret payload as// a template. If it is not set, no templating is used.Templating *Driver `json:",omitempty"`}SecretSpec represents a secret specification from a secret in swarm
typeService¶
type Service struct {IDstringMetaSpecServiceSpec `json:",omitempty"`PreviousSpec *ServiceSpec `json:",omitempty"`EndpointEndpoint `json:",omitempty"`UpdateStatus *UpdateStatus `json:",omitempty"`// ServiceStatus is an optional, extra field indicating the number of// desired and running tasks. It is provided primarily as a shortcut to// calculating these values client-side, which otherwise would require// listing all tasks for a service, an operation that could be// computation and network expensive.ServiceStatus *ServiceStatus `json:",omitempty"`// JobStatus is the status of a Service which is in one of ReplicatedJob or// GlobalJob modes. It is absent on Replicated and Global services.JobStatus *JobStatus `json:",omitempty"`}Service represents a service.
typeServiceCreateResponse¶
type ServiceCreateResponse struct {// The ID of the created service.// Example: ak7w3gjqoa3kuz8xcpnyy0pvlIDstring `json:"ID,omitempty"`// Optional warning message.//// FIXME(thaJeztah): this should have "omitempty" in the generated type.//// Example: ["unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"]Warnings []string `json:"Warnings"`}ServiceCreateResponse contains the information returned to a client on thecreation of a new service.
swagger:model ServiceCreateResponse
typeServiceMode¶
type ServiceMode struct {Replicated *ReplicatedService `json:",omitempty"`Global *GlobalService `json:",omitempty"`ReplicatedJob *ReplicatedJob `json:",omitempty"`GlobalJob *GlobalJob `json:",omitempty"`}ServiceMode represents the mode of a service.
typeServiceSpec¶
type ServiceSpec struct {Annotations// TaskTemplate defines how the service should construct new tasks when// orchestrating this service.TaskTemplateTaskSpec `json:",omitempty"`ModeServiceMode `json:",omitempty"`UpdateConfig *UpdateConfig `json:",omitempty"`RollbackConfig *UpdateConfig `json:",omitempty"`EndpointSpec *EndpointSpec `json:",omitempty"`}ServiceSpec represents the spec of a service.
typeServiceStatus¶
type ServiceStatus struct {// RunningTasks is the number of tasks for the service actually in the// Running stateRunningTasksuint64// DesiredTasks is the number of tasks desired to be running by the// service. For replicated services, this is the replica count. For global// services, this is computed by taking the number of tasks with desired// state of not-Shutdown.DesiredTasksuint64// CompletedTasks is the number of tasks in the state Completed, if this// service is in ReplicatedJob or GlobalJob mode. This field must be// cross-referenced with the service type, because the default value of 0// may mean that a service is not in a job mode, or it may mean that the// job has yet to complete any tasks.CompletedTasksuint64}ServiceStatus represents the number of running tasks in a service and thenumber of tasks desired to be running.
typeServiceUpdateResponse¶
type ServiceUpdateResponse struct {// Optional warning messagesWarnings []string `json:"Warnings"`}ServiceUpdateResponse service update responseExample: {"Warnings":["unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"]}
swagger:model ServiceUpdateResponse
typeSpec¶
type Spec struct {AnnotationsOrchestrationOrchestrationConfig `json:",omitempty"`RaftRaftConfig `json:",omitempty"`DispatcherDispatcherConfig `json:",omitempty"`CAConfigCAConfig `json:",omitempty"`TaskDefaultsTaskDefaults `json:",omitempty"`EncryptionConfigEncryptionConfig `json:",omitempty"`}Spec represents the spec of a swarm.
typeSpreadOver¶
type SpreadOver struct {// label descriptor, such as engine.labels.azSpreadDescriptorstring}SpreadOver is a scheduling preference that instructs the scheduler to spreadtasks evenly over groups of nodes identified by labels.
typeTLSInfo¶
type TLSInfo struct {// TrustRoot is the trusted CA root certificate in PEM formatTrustRootstring `json:",omitempty"`// CertIssuer is the raw subject bytes of the issuerCertIssuerSubject []byte `json:",omitempty"`// CertIssuerPublicKey is the raw public key bytes of the issuerCertIssuerPublicKey []byte `json:",omitempty"`}TLSInfo represents the TLS information about what CA certificate is trusted,and who the issuer for a TLS certificate is
typeTask¶
type Task struct {IDstringMetaAnnotationsSpecTaskSpec `json:",omitempty"`ServiceIDstring `json:",omitempty"`Slotint `json:",omitempty"`NodeIDstring `json:",omitempty"`StatusTaskStatus `json:",omitempty"`DesiredStateTaskState `json:",omitempty"`NetworksAttachments []NetworkAttachment `json:",omitempty"`GenericResources []GenericResource `json:",omitempty"`// JobIteration is the JobIteration of the Service that this Task was// spawned from, if the Service is a ReplicatedJob or GlobalJob. This is// used to determine which Tasks belong to which run of the job. This field// is absent if the Service mode is Replicated or Global.JobIteration *Version `json:",omitempty"`// Volumes is the list of VolumeAttachments for this task. It specifies// which particular volumes are to be used by this particular task, and// fulfilling what mounts in the spec.Volumes []VolumeAttachment}Task represents a task.
typeTaskDefaults¶
type TaskDefaults struct {// LogDriver selects the log driver to use for tasks created in the// orchestrator if unspecified by a service.//// Updating this value will only have an affect on new tasks. Old tasks// will continue use their previously configured log driver until// recreated.LogDriver *Driver `json:",omitempty"`}TaskDefaults parameterizes cluster-level task creation with default values.
typeTaskSpec¶
type TaskSpec struct {// ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually exclusive.// PluginSpec is only used when the `Runtime` field is set to `plugin`// NetworkAttachmentSpec is used if the `Runtime` field is set to// `attachment`.ContainerSpec *ContainerSpec `json:",omitempty"`PluginSpec *RuntimeSpec `json:",omitempty"`NetworkAttachmentSpec *NetworkAttachmentSpec `json:",omitempty"`Resources *ResourceRequirements `json:",omitempty"`RestartPolicy *RestartPolicy `json:",omitempty"`Placement *Placement `json:",omitempty"`Networks []NetworkAttachmentConfig `json:",omitempty"`// LogDriver specifies the LogDriver to use for tasks created from this// spec. If not present, the one on cluster default on swarm.Spec will be// used, finally falling back to the engine default if not specified.LogDriver *Driver `json:",omitempty"`// ForceUpdate is a counter that triggers an update even if no relevant// parameters have been changed.ForceUpdateuint64RuntimeRuntimeType `json:",omitempty"`}TaskSpec represents the spec of a task.
typeTaskState¶
type TaskStatestring
TaskState represents the state of a task.
const (// TaskStateNew NEWTaskStateNewTaskState = "new"// TaskStateAllocated ALLOCATEDTaskStateAllocatedTaskState = "allocated"// TaskStatePending PENDINGTaskStatePendingTaskState = "pending"// TaskStateAssigned ASSIGNEDTaskStateAssignedTaskState = "assigned"// TaskStateAccepted ACCEPTEDTaskStateAcceptedTaskState = "accepted"// TaskStatePreparing PREPARINGTaskStatePreparingTaskState = "preparing"// TaskStateReady READYTaskStateReadyTaskState = "ready"// TaskStateStarting STARTINGTaskStateStartingTaskState = "starting"// TaskStateRunning RUNNINGTaskStateRunningTaskState = "running"// TaskStateComplete COMPLETETaskStateCompleteTaskState = "complete"// TaskStateShutdown SHUTDOWNTaskStateShutdownTaskState = "shutdown"// TaskStateFailed FAILEDTaskStateFailedTaskState = "failed"// TaskStateRejected REJECTEDTaskStateRejectedTaskState = "rejected"// TaskStateRemove REMOVETaskStateRemoveTaskState = "remove"// TaskStateOrphaned ORPHANEDTaskStateOrphanedTaskState = "orphaned")
typeTaskStatus¶
type TaskStatus struct {Timestamptime.Time `json:",omitempty"`StateTaskState `json:",omitempty"`Messagestring `json:",omitempty"`Errstring `json:",omitempty"`ContainerStatus *ContainerStatus `json:",omitempty"`PortStatusPortStatus `json:",omitempty"`}TaskStatus represents the status of a task.
typeTopology¶
Topology defines the CSI topology of this node. This type is a duplicate ofgithub.com/moby/moby/api/types/volume.Topology. Because the type definitionis so simple and to avoid complicated structure or circular imports, we justduplicate it here. See that type for full documentation
typeUnlockKeyResponse¶
type UnlockKeyResponse struct {// UnlockKey is the unlock key in ASCII-armored format.UnlockKeystring}UnlockKeyResponse contains the response for Engine API:GET /swarm/unlockkey
typeUnlockRequest¶
type UnlockRequest struct {// UnlockKey is the unlock key in ASCII-armored format.UnlockKeystring}UnlockRequest is the request used to unlock a swarm.
typeUpdateConfig¶
type UpdateConfig struct {// Maximum number of tasks to be updated in one iteration.// 0 means unlimited parallelism.Parallelismuint64// Amount of time between updates.Delaytime.Duration `json:",omitempty"`// FailureAction is the action to take when an update failures.FailureActionFailureAction `json:",omitempty"`// Monitor indicates how long to monitor a task for failure after it is// created. If the task fails by ending up in one of the states// REJECTED, COMPLETED, or FAILED, within Monitor from its creation,// this counts as a failure. If it fails after Monitor, it does not// count as a failure. If Monitor is unspecified, a default value will// be used.Monitortime.Duration `json:",omitempty"`// MaxFailureRatio is the fraction of tasks that may fail during// an update before the failure action is invoked. Any task created by// the current update which ends up in one of the states REJECTED,// COMPLETED or FAILED within Monitor from its creation counts as a// failure. The number of failures is divided by the number of tasks// being updated, and if this fraction is greater than// MaxFailureRatio, the failure action is invoked.//// If the failure action is CONTINUE, there is no effect.// If the failure action is PAUSE, no more tasks will be updated until// another update is started.MaxFailureRatiofloat32// Order indicates the order of operations when rolling out an updated// task. Either the old task is shut down before the new task is// started, or the new task is started before the old task is shut down.OrderUpdateOrder}UpdateConfig represents the update configuration.
typeUpdateOrder¶
type UpdateOrderstring
UpdateOrder is the order of operations when rolling out or rolling backan updated tasks for a service.
const (// UpdateOrderStopFirst STOP_FIRSTUpdateOrderStopFirstUpdateOrder = "stop-first"// UpdateOrderStartFirst START_FIRSTUpdateOrderStartFirstUpdateOrder = "start-first")
typeUpdateState¶
type UpdateStatestring
UpdateState is the state of a service update.
const (// UpdateStateUpdating is the updating state.UpdateStateUpdatingUpdateState = "updating"// UpdateStatePaused is the paused state.UpdateStatePausedUpdateState = "paused"// UpdateStateCompleted is the completed state.UpdateStateCompletedUpdateState = "completed"// UpdateStateRollbackStarted is the state with a rollback in progress.UpdateStateRollbackStartedUpdateState = "rollback_started"// UpdateStateRollbackPaused is the state with a rollback in progress.UpdateStateRollbackPausedUpdateState = "rollback_paused"// UpdateStateRollbackCompleted is the state with a rollback in progress.UpdateStateRollbackCompletedUpdateState = "rollback_completed")
typeUpdateStatus¶
type UpdateStatus struct {StateUpdateState `json:",omitempty"`StartedAt *time.Time `json:",omitempty"`CompletedAt *time.Time `json:",omitempty"`Messagestring `json:",omitempty"`}UpdateStatus reports the status of a service update.
typeVersion¶
type Version struct {Indexuint64 `json:",omitempty"`}Version represents the internal object version.
typeVolumeAttachment¶
type VolumeAttachment struct {// ID is the Swarmkit ID of the Volume. This is not the CSI VolumeId.IDstring `json:",omitempty"`// Source, together with Target, indicates the Mount, as specified in the// ContainerSpec, that this volume fulfills.Sourcestring `json:",omitempty"`// Target, together with Source, indicates the Mount, as specified// in the ContainerSpec, that this volume fulfills.Targetstring `json:",omitempty"`}VolumeAttachment contains the associating a Volume to a Task.