config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuntimeModeTakod = "takod"

	RuntimeProxyTako = "tako-proxy"

	DeploymentSourceLocal = "local"
	DeploymentSourceGit   = "git"

	StateBackendReplicated = "replicated"

	StateDeployConsistencyLease = "lease"

	StateUnreachableBlock = "block"
)

Variables

This section is empty.

Functions

func IsNFSVolume added in v0.1.2

func IsNFSVolume(volumeSpec string) bool

IsNFSVolume checks if a volume spec uses the removed nfs: prefix.

func LoadEnvFile

func LoadEnvFile(path string) (map[string]string, error)

LoadEnvFile reads a .env file and returns a map of environment variables Supports: - KEY=value format - Comments (lines starting with #) - Empty lines - Single and double quoted values - Variable expansion ${VAR} syntax

func MergeEnvVars

func MergeEnvVars(explicitEnv map[string]string, envFileVars map[string]string) map[string]string

MergeEnvVars merges environment variables from multiple sources Priority (highest to lowest): 1. Explicit env vars from config (service.Env) 2. Variables from envFile (service.EnvFile) 3. System environment variables (already expanded via ${VAR} syntax)

func NormalizeProxyDomain added in v0.3.0

func NormalizeProxyDomain(domain string) (string, error)

NormalizeProxyDomain trims and validates a domain before it is used in proxy routing configuration.

func NormalizeRegistryServer added in v0.3.0

func NormalizeRegistryServer(value string) string

func ResolvePlacementTargets added in v0.3.0

func ResolvePlacementTargets(placement *PlacementConfig, servers map[string]ServerConfig, environmentServers []string, environment string) ([]string, error)

ResolvePlacementTargets returns the ordered node set a service may use after applying placement strategy and supported node label constraints.

func SaveConfig added in v0.2.0

func SaveConfig(configPath string, cfg *Config) error

SaveConfig writes the configuration to a YAML or JSON file based on extension

func ValidateConfig

func ValidateConfig(cfg *Config) error

ValidateConfig validates the configuration

func ValidatePlacementConfig added in v0.3.0

func ValidatePlacementConfig(placement *PlacementConfig) error

func ValidateVolumeMountSpec added in v0.3.0

func ValidateVolumeMountSpec(volume string) error

Types

type AgentConfig added in v0.3.0

type AgentConfig struct {
	Enabled *bool  `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Socket  string `yaml:"socket,omitempty" json:"socket,omitempty"`
	DataDir string `yaml:"dataDir,omitempty" json:"dataDir,omitempty"`
}

AgentConfig describes the takod node-local reconciler.

type BackupConfig

type BackupConfig struct {
	Schedule string `yaml:"schedule" json:"schedule"` // cron format (e.g., "0 2 * * *")
	Retain   int    `yaml:"retain" json:"retain"`     // days to retain backups
}

BackupConfig defines per-service backup settings

type CacheConfig

type CacheConfig struct {
	Enabled   bool   `yaml:"enabled,omitempty" json:"enabled,omitempty"`     // Enable build caching (default: true)
	Type      string `yaml:"type,omitempty" json:"type,omitempty"`           // "local" (default), "registry"
	Retention string `yaml:"retention,omitempty" json:"retention,omitempty"` // Cache retention period (e.g., "7d")
	Ref       string `yaml:"ref,omitempty" json:"ref,omitempty"`             // Registry cache reference for type=registry
	Builder   string `yaml:"builder,omitempty" json:"builder,omitempty"`     // Optional docker buildx builder name
}

CacheConfig defines build caching settings

type Config

type Config struct {
	Schema        string                       `yaml:"$schema,omitempty" json:"$schema,omitempty"` // JSON Schema reference
	Project       ProjectConfig                `yaml:"project" json:"project"`
	Runtime       *RuntimeConfig               `yaml:"runtime,omitempty" json:"runtime,omitempty"`
	Mesh          *MeshConfig                  `yaml:"mesh,omitempty" json:"mesh,omitempty"`
	State         *StateConfig                 `yaml:"state,omitempty" json:"state,omitempty"`
	Deployment    *DeploymentConfig            `yaml:"deployment,omitempty" json:"deployment,omitempty"`
	Registry      *RegistryConfig              `yaml:"registry,omitempty" json:"registry,omitempty"`
	Notifications *NotificationsConfig         `yaml:"notifications,omitempty" json:"notifications,omitempty"`
	Volumes       map[string]VolumeConfig      `yaml:"volumes,omitempty" json:"volumes,omitempty"` // Top-level volume definitions
	Configs       map[string]ConfigFileConfig  `yaml:"configs,omitempty" json:"configs,omitempty"` // Top-level config file artifacts
	Imports       map[string]ImportConfig      `yaml:"imports,omitempty" json:"imports,omitempty"` // Cross-project service imports
	Servers       map[string]ServerConfig      `yaml:"servers" json:"servers"`
	Environments  map[string]EnvironmentConfig `yaml:"environments" json:"environments"`
}

Config represents the main configuration structure

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig loads the configuration from a YAML or JSON file

func (*Config) DeploymentCache added in v0.3.0

func (c *Config) DeploymentCache() *CacheConfig

func (*Config) DeploymentSource added in v0.3.0

func (c *Config) DeploymentSource() string

func (*Config) GetAllDefinedVolumes added in v0.1.3

func (c *Config) GetAllDefinedVolumes() map[string]VolumeConfig

GetAllDefinedVolumes returns all top-level volume definitions

func (*Config) GetDefaultEnvironment

func (c *Config) GetDefaultEnvironment() string

GetDefaultEnvironment returns the default environment name Returns "production" if it exists, otherwise the first environment

func (*Config) GetDefaultServer added in v0.3.0

func (c *Config) GetDefaultServer(envName string) (string, error)

GetDefaultServer returns the deterministic default node for an environment.

func (*Config) GetDeployConsistency added in v0.3.0

func (c *Config) GetDeployConsistency() string

GetDeployConsistency returns the deployment consistency policy.

func (*Config) GetDeploymentStrategy

func (c *Config) GetDeploymentStrategy() string

GetDeploymentStrategy returns the deployment strategy (parallel or sequential)

func (*Config) GetEnvironment

func (c *Config) GetEnvironment(name string) (*EnvironmentConfig, error)

GetEnvironment retrieves a specific environment configuration If name is empty, returns the default environment

func (*Config) GetEnvironmentServers

func (c *Config) GetEnvironmentServers(envName string) ([]string, error)

GetEnvironmentServers returns the list of servers for an environment

func (*Config) GetFullImageName

func (c *Config) GetFullImageName(serviceName string, envName string) string

GetFullImageName returns the full image name with registry and environment tag

func (*Config) GetMaxConcurrentBuilds

func (c *Config) GetMaxConcurrentBuilds() int

GetMaxConcurrentBuilds returns the max concurrent builds configuration

func (*Config) GetMaxConcurrentDeploys

func (c *Config) GetMaxConcurrentDeploys() int

GetMaxConcurrentDeploys returns the max concurrent deploys configuration

func (*Config) GetOnUnreachableNode added in v0.3.0

func (c *Config) GetOnUnreachableNode() string

GetOnUnreachableNode returns the policy used when a node cannot be reached.

func (*Config) GetRegistryURL

func (c *Config) GetRegistryURL() string

GetRegistryURL returns the auto-configured local registry URL Returns empty string for single-server deployments (no registry needed)

func (*Config) GetRuntimeMode added in v0.3.0

func (c *Config) GetRuntimeMode() string

GetRuntimeMode returns the configured orchestration runtime.

func (*Config) GetRuntimeProxy added in v0.3.0

func (c *Config) GetRuntimeProxy() string

GetRuntimeProxy returns the internal ingress proxy implementation.

func (*Config) GetService

func (c *Config) GetService(envName string, serviceName string) (*ServiceConfig, error)

GetService returns a specific service from an environment

func (*Config) GetServices

func (c *Config) GetServices(envName string) (map[string]ServiceConfig, error)

GetServices returns services for a specific environment

func (*Config) GetStateBackend added in v0.3.0

func (c *Config) GetStateBackend() string

GetStateBackend returns the configured state backend.

func (*Config) GetVolume added in v0.1.3

func (c *Config) GetVolume(name string) (*VolumeConfig, bool)

GetVolume returns a volume configuration by name

func (*Config) GetVolumeName added in v0.1.3

func (c *Config) GetVolumeName(volumeKey, envName string) string

GetVolumeName returns the actual Docker volume name for a defined volume If the volume has a custom name, use it; otherwise, apply project/env prefix

func (*Config) IsCacheEnabled

func (c *Config) IsCacheEnabled() bool

IsCacheEnabled returns true if build caching is enabled

func (*Config) IsMeshEnabled added in v0.3.0

func (c *Config) IsMeshEnabled() bool

IsMeshEnabled returns true when the private node mesh is enabled.

func (*Config) IsMultiServer

func (c *Config) IsMultiServer() bool

IsMultiServer returns true if more than one server is configured

func (*Config) IsParallelDeployment

func (c *Config) IsParallelDeployment() bool

IsParallelDeployment returns true if parallel deployment is enabled

func (*Config) IsTakodRuntime added in v0.3.0

func (c *Config) IsTakodRuntime() bool

IsTakodRuntime returns true when the current runtime is the takod mesh runtime.

func (*Config) IsVolumeExternal added in v0.1.3

func (c *Config) IsVolumeExternal(name string) bool

IsVolumeExternal checks if a volume is marked as external

func (*Config) RegistryAuthForImage added in v0.3.0

func (c *Config) RegistryAuthForImage(image string) *RegistryAuthConfig

RegistryAuthForImage returns registry credentials for an image when the configured registry host matches the image reference.

type ConfigFileConfig added in v0.3.0

type ConfigFileConfig struct {
	Source   string                 `yaml:"source,omitempty" json:"source,omitempty"`     // Local file path relative to the project checkout
	Generate *GeneratedConfigConfig `yaml:"generate,omitempty" json:"generate,omitempty"` // Generated artifact definition
}

ConfigFileConfig defines a project-owned file artifact that can be mounted into services.

type DeployConfig

type DeployConfig struct {
	Strategy       string `yaml:"strategy,omitempty" json:"strategy,omitempty"` // recreate, rolling
	Order          string `yaml:"order,omitempty" json:"order,omitempty"`       // start-first, stop-first
	MaxUnavailable int    `yaml:"maxUnavailable,omitempty" json:"maxUnavailable,omitempty"`
	Monitor        string `yaml:"monitor,omitempty" json:"monitor,omitempty"` // e.g. 30s
}

DeployConfig defines deployment strategy

type DeploymentConfig

type DeploymentConfig struct {
	Strategy string          `yaml:"strategy,omitempty" json:"strategy,omitempty"` // "parallel" or "sequential" (default: sequential)
	Source   string          `yaml:"source,omitempty" json:"source,omitempty"`     // "local" (default) or "git"
	Parallel *ParallelConfig `yaml:"parallel,omitempty" json:"parallel,omitempty"`
	Cache    *CacheConfig    `yaml:"cache,omitempty" json:"cache,omitempty"`
}

DeploymentConfig defines deployment optimization settings

type EnvironmentConfig

type EnvironmentConfig struct {
	Servers        []string                 `yaml:"servers" json:"servers"`                                   // List of server names to use
	ServerSelector *ServerSelector          `yaml:"serverSelector,omitempty" json:"serverSelector,omitempty"` // Label-based server selection
	Labels         map[string]string        `yaml:"labels,omitempty" json:"labels,omitempty"`                 // Environment labels for nodes
	Services       map[string]ServiceConfig `yaml:"services" json:"services"`                                 // Services to deploy in this environment
}

EnvironmentConfig defines an environment (production, staging, etc.)

type GeneratedCaddyConfig added in v0.3.0

type GeneratedCaddyConfig struct {
	Email          string `yaml:"email" json:"email"`
	AdminHost      string `yaml:"adminHost" json:"adminHost"`
	SiteHost       string `yaml:"siteHost" json:"siteHost"`
	AdminImport    string `yaml:"adminImport" json:"adminImport"`
	RendererImport string `yaml:"rendererImport" json:"rendererImport"`
	AskImport      string `yaml:"askImport,omitempty" json:"askImport,omitempty"`
	AskPath        string `yaml:"askPath,omitempty" json:"askPath,omitempty"`
	OnDemandTLS    bool   `yaml:"onDemandTLS,omitempty" json:"onDemandTLS,omitempty"`
}

GeneratedCaddyConfig renders a Caddyfile from cross-project imports.

type GeneratedConfigConfig added in v0.3.0

type GeneratedConfigConfig struct {
	Caddy *GeneratedCaddyConfig `yaml:"caddy,omitempty" json:"caddy,omitempty"`
}

GeneratedConfigConfig defines a generated config artifact.

type HealthCheckConfig

type HealthCheckConfig struct {
	Path        string `yaml:"path" json:"path"`
	Interval    string `yaml:"interval" json:"interval"`
	Timeout     string `yaml:"timeout" json:"timeout"`
	Retries     int    `yaml:"retries" json:"retries"`
	StartPeriod string `yaml:"startPeriod,omitempty" json:"startPeriod,omitempty"` // Grace period before starting checks
}

HealthCheckConfig defines health check settings

type HookConfig added in v0.3.0

type HookConfig struct {
	Command    string            `yaml:"command" json:"command"`
	Timeout    string            `yaml:"timeout,omitempty" json:"timeout,omitempty"`
	Env        map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
	Secrets    []string          `yaml:"secrets,omitempty" json:"secrets,omitempty"`
	User       string            `yaml:"user,omitempty" json:"user,omitempty"`
	WorkingDir string            `yaml:"workingDir,omitempty" json:"workingDir,omitempty"`
}

HookConfig defines a short-lived container command run from the service image.

type HooksConfig

type HooksConfig struct {
	PreDeploy  *HookConfig `yaml:"preDeploy,omitempty" json:"preDeploy,omitempty"`
	PostDeploy *HookConfig `yaml:"postDeploy,omitempty" json:"postDeploy,omitempty"`
}

HooksConfig defines pre/post deploy hooks for a service.

type ImportConfig added in v0.3.0

type ImportConfig struct {
	Project     string   `yaml:"project" json:"project"`
	Environment string   `yaml:"environment" json:"environment"`
	Service     string   `yaml:"service" json:"service"`
	Port        string   `yaml:"port" json:"port"`
	Servers     []string `yaml:"servers,omitempty" json:"servers,omitempty"` // Optional configured server names to query for the exported project
}

ImportConfig defines a named cross-project service import.

type LoadBalancerConfig

type LoadBalancerConfig struct {
	Strategy    string                  `yaml:"strategy" json:"strategy"` // round_robin, least_conn, ip_hash, random
	HealthCheck LoadBalancerHealthCheck `yaml:"healthCheck,omitempty" json:"healthCheck,omitempty"`
}

LoadBalancerConfig defines load balancing settings

type LoadBalancerHealthCheck

type LoadBalancerHealthCheck struct {
	Enabled  bool   `yaml:"enabled" json:"enabled"`
	Path     string `yaml:"path" json:"path"`
	Interval string `yaml:"interval" json:"interval"`
}

LoadBalancerHealthCheck defines load balancer health check settings

type MeshConfig added in v0.3.0

type MeshConfig struct {
	Enabled      *bool  `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	NetworkCIDR  string `yaml:"networkCIDR,omitempty" json:"networkCIDR,omitempty"`
	Interface    string `yaml:"interface,omitempty" json:"interface,omitempty"`
	ListenPort   int    `yaml:"listenPort,omitempty" json:"listenPort,omitempty"`
	SubnetBits   int    `yaml:"subnetBits,omitempty" json:"subnetBits,omitempty"`
	NATTraversal bool   `yaml:"natTraversal,omitempty" json:"natTraversal,omitempty"`
}

MeshConfig describes the private node mesh. A single node still uses the same model, with no remote peers.

type MonitoringConfig

type MonitoringConfig struct {
	Enabled   bool   `yaml:"enabled" json:"enabled"`                         // Enable monitoring for this service
	Interval  string `yaml:"interval,omitempty" json:"interval,omitempty"`   // Check interval (e.g., "60s")
	Webhook   string `yaml:"webhook,omitempty" json:"webhook,omitempty"`     // Webhook URL for alerts
	CheckType string `yaml:"checkType,omitempty" json:"checkType,omitempty"` // "http" or "container" (default: auto-detect)
}

MonitoringConfig defines per-service monitoring settings

type NotificationsConfig added in v0.0.3

type NotificationsConfig struct {
	Slack   string `yaml:"slack,omitempty" json:"slack,omitempty"`     // Slack webhook URL
	Discord string `yaml:"discord,omitempty" json:"discord,omitempty"` // Discord webhook URL
	Webhook string `yaml:"webhook,omitempty" json:"webhook,omitempty"` // Generic webhook URL
}

NotificationsConfig defines notification settings

type ParallelConfig

type ParallelConfig struct {
	MaxConcurrentBuilds  int    `yaml:"maxConcurrentBuilds,omitempty" json:"maxConcurrentBuilds,omitempty"`   // Default: 4
	MaxConcurrentDeploys int    `yaml:"maxConcurrentDeploys,omitempty" json:"maxConcurrentDeploys,omitempty"` // Default: 4
	Strategy             string `yaml:"strategy,omitempty" json:"strategy,omitempty"`                         // "dependency-aware" (default), "resource-aware", "round-robin"
}

ParallelConfig defines parallel deployment settings

type PlacementConfig

type PlacementConfig struct {
	Strategy    string   `yaml:"strategy,omitempty" json:"strategy,omitempty"`       // "spread", "pinned", "any"
	Servers     []string `yaml:"servers,omitempty" json:"servers,omitempty"`         // Pin to specific servers (for "pinned" strategy)
	Constraints []string `yaml:"constraints,omitempty" json:"constraints,omitempty"` // Node label constraints (e.g., "node.labels.type==high-memory")
	Preferences []string `yaml:"preferences,omitempty" json:"preferences,omitempty"` // Placement preferences (e.g., "spread=node.labels.region")
}

PlacementConfig defines where service replicas should run

type PortConfig added in v0.3.0

type PortConfig struct {
	Name      string       `yaml:"name,omitempty" json:"name,omitempty"`
	Target    int          `yaml:"target" json:"target"`
	Published int          `yaml:"published,omitempty" json:"published,omitempty"`
	Protocol  string       `yaml:"protocol,omitempty" json:"protocol,omitempty"` // http, https, tcp, udp
	Mode      string       `yaml:"mode,omitempty" json:"mode,omitempty"`         // internal, proxy, host
	HostIP    string       `yaml:"hostIP,omitempty" json:"hostIP,omitempty"`     // IP or CIDR for host mode
	Internal  bool         `yaml:"internal,omitempty" json:"internal,omitempty"`
	Proxy     *ProxyConfig `yaml:"proxy,omitempty" json:"proxy,omitempty"`
}

PortConfig defines a named service port. The legacy ServiceConfig.Port field remains shorthand for one internal or proxied HTTP port.

func (PortConfig) ProxyScheme added in v0.3.0

func (p PortConfig) ProxyScheme() string

type ProjectConfig

type ProjectConfig struct {
	Name    string `yaml:"name" json:"name"`
	Version string `yaml:"version" json:"version"`
}

ProjectConfig defines project metadata

type ProxyConfig

type ProxyConfig struct {
	// Domain is where traffic is served.
	Domain string `yaml:"domain,omitempty" json:"domain,omitempty"`

	// RedirectFrom specifies domains that should redirect to the primary Domain
	// These domains will get their own TLS certificates and 301 redirect to Domain
	// Example: ["www.example.com", "old.example.com"] -> redirects to "example.com"
	RedirectFrom []string `yaml:"redirectFrom,omitempty" json:"redirectFrom,omitempty"`

	Email string    `yaml:"email,omitempty" json:"email,omitempty"` // Email for Let's Encrypt
	TLS   TLSConfig `yaml:"tls,omitempty" json:"tls,omitempty"`
}

ProxyConfig defines per-service public proxy settings.

func (*ProxyConfig) GetAllDomains added in v0.0.3

func (p *ProxyConfig) GetAllDomains() []string

GetAllDomains returns all serving domains, excluding redirect domains.

func (*ProxyConfig) GetPrimaryDomain added in v0.0.3

func (p *ProxyConfig) GetPrimaryDomain() string

GetPrimaryDomain returns the primary domain for this service

func (*ProxyConfig) GetRedirectDomains added in v0.0.3

func (p *ProxyConfig) GetRedirectDomains() []string

GetRedirectDomains returns all domains that should redirect to the primary domain

func (*ProxyConfig) HasRedirects added in v0.0.3

func (p *ProxyConfig) HasRedirects() bool

HasRedirects returns true if there are redirect domains configured

type RegistryAuthConfig added in v0.3.0

type RegistryAuthConfig struct {
	Server        string
	Username      string
	Password      string
	IdentityToken string
}

RegistryAuthConfig is the sanitized registry auth material used for a pull.

type RegistryConfig added in v0.3.0

type RegistryConfig struct {
	URL           string `yaml:"url,omitempty" json:"url,omitempty"`
	Username      string `yaml:"username,omitempty" json:"username,omitempty"`
	Password      string `yaml:"password,omitempty" json:"password,omitempty"`
	IdentityToken string `yaml:"identityToken,omitempty" json:"identityToken,omitempty"`
}

RegistryConfig defines credentials for pulling private images.

type RuntimeConfig added in v0.3.0

type RuntimeConfig struct {
	Mode  string       `yaml:"mode,omitempty" json:"mode,omitempty"` // takod
	Proxy string       `yaml:"proxy,omitempty" json:"proxy,omitempty"`
	Agent *AgentConfig `yaml:"agent,omitempty" json:"agent,omitempty"`
}

RuntimeConfig selects the orchestration runtime. Tako has one public runtime: takod. Single-node deployments are just one-node meshes.

type ServerConfig

type ServerConfig struct {
	Host     string            `yaml:"host" json:"host"`
	User     string            `yaml:"user" json:"user"`
	Port     int               `yaml:"port,omitempty" json:"port,omitempty"`
	SSHKey   string            `yaml:"sshKey,omitempty" json:"sshKey,omitempty"`     // Path to SSH private key (mutually exclusive with password)
	Password string            `yaml:"password,omitempty" json:"password,omitempty"` // SSH password (mutually exclusive with sshKey, use env var for security)
	Labels   map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`     // Custom labels for server selection
}

ServerConfig defines server connection details

type ServerSelector

type ServerSelector struct {
	Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"` // Match servers with these labels
	Any    bool              `yaml:"any,omitempty" json:"any,omitempty"`       // Select any available server
}

ServerSelector defines label-based server selection

type ServiceConfig

type ServiceConfig struct {
	// Build or Image (mutually exclusive)
	Build      string `yaml:"build,omitempty" json:"build,omitempty"`           // Path to build context (auto-detects Dockerfile)
	Dockerfile string `yaml:"dockerfile,omitempty" json:"dockerfile,omitempty"` // Dockerfile path relative to build context
	Image      string `yaml:"image,omitempty" json:"image,omitempty"`           // Pre-built image (for postgres, redis, etc)
	Platform   string `yaml:"platform,omitempty" json:"platform,omitempty"`     // Docker platform for service image builds, e.g. linux/amd64

	// Basic settings
	Port     int               `yaml:"port,omitempty" json:"port,omitempty"`
	Ports    []PortConfig      `yaml:"ports,omitempty" json:"ports,omitempty"`
	Command  string            `yaml:"command,omitempty" json:"command,omitempty"`
	Replicas int               `yaml:"replicas,omitempty" json:"replicas,omitempty"` // Default: 1
	Restart  string            `yaml:"restart,omitempty" json:"restart,omitempty"`   // Docker restart policy (always, unless-stopped, on-failure, no)
	Env      map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
	EnvFile  string            `yaml:"envFile,omitempty" json:"envFile,omitempty"` // Path to .env file (e.g., .env.production)

	// Secrets: ["DATABASE_URL", "JWT_SECRET"] or ["VAR_NAME:SECRET_KEY"].
	Secrets []string                 `yaml:"secrets,omitempty" json:"secrets,omitempty"` // Tako secrets from .tako/secrets files
	Volumes []string                 `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Configs []ServiceConfigFileMount `yaml:"configs,omitempty" json:"configs,omitempty"`

	// Service type flags
	Persistent bool `yaml:"persistent,omitempty" json:"persistent,omitempty"` // Don't remove on redeploy (databases, caches)

	// Per-service proxy settings (if present, service is exposed publicly)
	Proxy *ProxyConfig `yaml:"proxy,omitempty" json:"proxy,omitempty"`

	// Load balancing (for multi-replica services)
	LoadBalancer LoadBalancerConfig `yaml:"loadBalancer,omitempty" json:"loadBalancer,omitempty"`

	// Health checks
	HealthCheck HealthCheckConfig `yaml:"healthCheck,omitempty" json:"healthCheck,omitempty"`

	// Deployment strategy
	Deploy DeployConfig `yaml:"deploy,omitempty" json:"deploy,omitempty"`

	// Deployment hooks run as short-lived containers from this service image.
	Hooks HooksConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`

	// Per-service backup
	Backup *BackupConfig `yaml:"backup,omitempty" json:"backup,omitempty"`

	// Per-service monitoring
	Monitoring *MonitoringConfig `yaml:"monitoring,omitempty" json:"monitoring,omitempty"`

	// Cross-project networking
	Export *ServiceExportConfig `yaml:"export,omitempty" json:"export,omitempty"` // Explicit service ports exported to other projects

	// Placement configuration for takod scheduling.
	Placement *PlacementConfig `yaml:"placement,omitempty" json:"placement,omitempty"` // Where to run service replicas

	// Service dependencies (controls deployment order)
	DependsOn []string `yaml:"dependsOn,omitempty" json:"dependsOn,omitempty"` // List of service names this service depends on
}

ServiceConfig defines service deployment settings

func (*ServiceConfig) EffectivePorts added in v0.3.0

func (s *ServiceConfig) EffectivePorts() []PortConfig

EffectivePorts returns the explicit ports[] model plus the legacy port/proxy shorthand rendered as a single named port.

func (*ServiceConfig) GetServiceType

func (s *ServiceConfig) GetServiceType() string

GetServiceType returns the auto-detected service type

func (*ServiceConfig) IsInternal

func (s *ServiceConfig) IsInternal() bool

IsInternal returns true if service is internal-only

func (*ServiceConfig) IsPublic

func (s *ServiceConfig) IsPublic() bool

IsPublic returns true if service should be exposed publicly

func (*ServiceConfig) IsWorker

func (s *ServiceConfig) IsWorker() bool

IsWorker returns true if service is a background worker

func (*ServiceConfig) PrimaryTargetPort added in v0.3.0

func (s *ServiceConfig) PrimaryTargetPort() int

PrimaryTargetPort returns the target port used by service-level health checks and compatibility displays.

type ServiceConfigFileMount added in v0.3.0

type ServiceConfigFileMount struct {
	Source      string `yaml:"source" json:"source"`
	Target      string `yaml:"target" json:"target"`
	Mode        string `yaml:"mode,omitempty" json:"mode,omitempty"`
	ContentHash string `yaml:"-" json:"-"`
}

ServiceConfigFileMount maps a named project config file into a container.

type ServiceExportConfig added in v0.3.0

type ServiceExportConfig struct {
	Ports map[string]int `yaml:"ports,omitempty" json:"ports,omitempty"`
}

ServiceExportConfig defines explicitly exported named service ports.

type StateConfig added in v0.3.0

type StateConfig struct {
	Backend            string `yaml:"backend,omitempty" json:"backend,omitempty"`                       // replicated
	DeployConsistency  string `yaml:"deployConsistency,omitempty" json:"deployConsistency,omitempty"`   // lease
	OnUnreachableNode  string `yaml:"onUnreachableNode,omitempty" json:"onUnreachableNode,omitempty"`   // block
	RemoteCacheEnabled bool   `yaml:"remoteCacheEnabled,omitempty" json:"remoteCacheEnabled,omitempty"` // replicate deployment history to nodes
}

StateConfig controls how Tako treats local cache, remote runtime truth, and deployment consistency.

type TLSConfig

type TLSConfig struct {
	Provider string `yaml:"provider,omitempty" json:"provider,omitempty"` // letsencrypt, zerossl (default: letsencrypt)
	Staging  bool   `yaml:"staging,omitempty" json:"staging,omitempty"`
}

TLSConfig defines TLS settings

type VolumeConfig added in v0.1.3

type VolumeConfig struct {
	Driver     string            `yaml:"driver,omitempty" json:"driver,omitempty"`           // Volume driver (default: "local")
	DriverOpts map[string]string `yaml:"driver_opts,omitempty" json:"driver_opts,omitempty"` // Driver-specific options
	Labels     map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`           // Volume labels
	External   bool              `yaml:"external,omitempty" json:"external,omitempty"`       // If true, volume must already exist
	Replicated bool              `yaml:"replicated,omitempty" json:"replicated,omitempty"`   // App/external replication handles multi-node writes
	Name       string            `yaml:"name,omitempty" json:"name,omitempty"`               // Override the auto-generated name (opt-out of prefix)
}

VolumeConfig defines a named service volume configuration.

type VolumeMountSpec added in v0.3.0

type VolumeMountSpec struct {
	Source    string
	Target    string
	Mode      string
	HasTarget bool
}

func ParseVolumeMountSpec added in v0.3.0

func ParseVolumeMountSpec(volume string) (VolumeMountSpec, error)

Jump to

Keyboard shortcuts

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