provisioner

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirewallAllowedPorts added in v0.8.0

func FirewallAllowedPorts(meshListenPort int) []string

FirewallAllowedPorts lists the port/protocol pairs setup allows through UFW, in the order the rules are applied.

func PublishTakodUpgrade added in v0.10.0

func PublishTakodUpgrade(contract *nodeidentity.UpgradeContract, leaseToken string) error

PublishTakodUpgrade is executed by the checksum-verified candidate while its parent root shell holds the upgrade guard flock. It additionally holds the controller lifecycle barrier and the exact inventory publication lock across contract verification, rollback publication, and both binary renames.

Types

type ApkManager

type ApkManager struct {
	// contains filtered or unexported fields
}

ApkManager manages packages using apk

func (*ApkManager) Install

func (ap *ApkManager) Install(packages ...string) error

func (*ApkManager) Remove

func (ap *ApkManager) Remove(packages ...string) error

func (*ApkManager) Search

func (ap *ApkManager) Search(packageName string) (bool, error)

func (*ApkManager) Update

func (ap *ApkManager) Update() error

type AptManager

type AptManager struct {
	// contains filtered or unexported fields
}

AptManager manages packages using apt/apt-get

func (*AptManager) Install

func (a *AptManager) Install(packages ...string) error

func (*AptManager) Remove

func (a *AptManager) Remove(packages ...string) error

func (*AptManager) Search

func (a *AptManager) Search(packageName string) (bool, error)

func (*AptManager) Update

func (a *AptManager) Update() error

type DnfManager

type DnfManager struct {
	// contains filtered or unexported fields
}

DnfManager manages packages using dnf

func (*DnfManager) Install

func (d *DnfManager) Install(packages ...string) error

func (*DnfManager) Remove

func (d *DnfManager) Remove(packages ...string) error

func (*DnfManager) Search

func (d *DnfManager) Search(packageName string) (bool, error)

func (*DnfManager) Update

func (d *DnfManager) Update() error

type DockerRuntimeInfo added in v0.4.36

type DockerRuntimeInfo struct {
	ServerVersion   string
	RootDir         string
	SecurityOptions []string
	Rootless        bool
}

func DetectDockerRuntime added in v0.4.36

func DetectDockerRuntime(client commandExecutor) (*DockerRuntimeInfo, error)

type OSFamily

type OSFamily string

OSFamily represents different Linux distribution families

const (
	OSFamilyDebian  OSFamily = "debian"
	OSFamilyRHEL    OSFamily = "rhel"
	OSFamilySUSE    OSFamily = "suse"
	OSFamilyAlpine  OSFamily = "alpine"
	OSFamilyUnknown OSFamily = "unknown"
)

type OSInfo

type OSInfo struct {
	Family         OSFamily
	Name           string
	Version        string
	PackageManager string
}

OSInfo contains detected operating system information

func DetectOS

func DetectOS(client *ssh.Client) (*OSInfo, error)

DetectOS detects the operating system of the remote server

func (*OSInfo) IsSupported

func (info *OSInfo) IsSupported() bool

IsSupported returns true if the OS is supported

func (*OSInfo) String

func (info *OSInfo) String() string

String returns a human-readable representation of the OS

type PackageManager

type PackageManager interface {
	Update() error
	Install(packages ...string) error
	Remove(packages ...string) error
	Search(packageName string) (bool, error)
}

PackageManager defines interface for OS package management

func NewPackageManager

func NewPackageManager(client *ssh.Client, osInfo *OSInfo, verbose bool) (PackageManager, error)

NewPackageManager creates a package manager for the detected OS

type Provisioner

type Provisioner struct {
	// contains filtered or unexported fields
}

Provisioner handles server provisioning

func NewProvisioner

func NewProvisioner(client *ssh.Client, verbose bool) *Provisioner

NewProvisioner creates a new provisioner

func (*Provisioner) AcquireTakodUpgradeCoordinatorLock added in v0.10.0

func (p *Provisioner) AcquireTakodUpgradeCoordinatorLock(ttl time.Duration) error

AcquireTakodUpgradeCoordinatorLock serializes staged upgrade coordinators on the authoritative controller. The token-bound lease rejects overlap while still allowing recovery after a dead CLI.

func (*Provisioner) ActivateTakodUpgrade added in v0.10.0

func (p *Provisioner) ActivateTakodUpgrade() error

ActivateTakodUpgrade restarts both services after their binary handoff.

func (*Provisioner) BeginTakodUpgrade added in v0.10.0

func (p *Provisioner) BeginTakodUpgrade(version string, localPath string, revalidate func() (*nodeidentity.UpgradeContract, error)) error

BeginTakodUpgrade publishes a verified candidate with a durable rollback copy. When the protected platform-worker binary exists it is included in the same transaction, so the deployment worker never remains permanently pinned to an older executable. An interrupted prior transaction is rolled back before a new one begins.

func (*Provisioner) CheckRequirements

func (p *Provisioner) CheckRequirements() error

CheckRequirements checks if the server meets basic requirements

func (*Provisioner) CommitTakodUpgrade added in v0.10.0

func (p *Provisioner) CommitTakodUpgrade() error

func (*Provisioner) ConfigureFirewall

func (p *Provisioner) ConfigureFirewall(meshListenPort int) error

ConfigureFirewall configures UFW when available. Non-Debian cloud images commonly rely on provider firewalls instead of UFW; setup should not fail on those hosts merely because the ufw package is unavailable.

func (*Provisioner) HardenSecurity

func (p *Provisioner) HardenSecurity() error

HardenSecurity applies comprehensive security hardening

func (*Provisioner) InstallDocker

func (p *Provisioner) InstallDocker() error

InstallDocker installs and enables the container runtime used by takod.

func (*Provisioner) InstallMonitoringAgent

func (p *Provisioner) InstallMonitoringAgent() error

InstallMonitoringAgent installs the lightweight monitoring agent

func (*Provisioner) InstallTakodBinary added in v0.3.0

func (p *Provisioner) InstallTakodBinary(version string) error

func (*Provisioner) InstallTakodBinaryFromFile added in v0.3.0

func (p *Provisioner) InstallTakodBinaryFromFile(localPath string) error

func (*Provisioner) InstallTakodService added in v0.3.0

func (p *Provisioner) InstallTakodService(socket string, dataDir string, nodeName string) error

func (*Provisioner) InstallWireGuard added in v0.3.0

func (p *Provisioner) InstallWireGuard() error

func (*Provisioner) RefreshTakodUpgradeCoordinatorLock added in v0.10.0

func (p *Provisioner) RefreshTakodUpgradeCoordinatorLock(ttl time.Duration) error

func (*Provisioner) ReleaseTakodUpgradeCoordinatorLock added in v0.10.0

func (p *Provisioner) ReleaseTakodUpgradeCoordinatorLock() error

func (*Provisioner) RollbackTakodUpgrade added in v0.10.0

func (p *Provisioner) RollbackTakodUpgrade() error

func (*Provisioner) SetOutput added in v0.8.0

func (p *Provisioner) SetOutput(w io.Writer)

SetOutput redirects provisioning progress output. Passing nil resets output to os.Stdout.

func (*Provisioner) SetupDeployUser

func (p *Provisioner) SetupDeployUser(username string) error

SetupDeployUser ensures deploy user exists and has proper permissions

func (*Provisioner) UpdateSystem

func (p *Provisioner) UpdateSystem() error

UpdateSystem updates system packages

func (*Provisioner) VerifyAutoRecovery

func (p *Provisioner) VerifyAutoRecovery() error

VerifyAutoRecovery verifies that critical services are enabled for auto-recovery

func (*Provisioner) VerifySupportedDockerRuntime added in v0.4.36

func (p *Provisioner) VerifySupportedDockerRuntime() error

func (*Provisioner) VerifyTakodUpgradeServices added in v0.10.0

func (p *Provisioner) VerifyTakodUpgradeServices(requirePlatformWorker bool) error

VerifyTakodUpgradeServices checks the protected handoff before rollback evidence is discarded. systemd starts both units from the newly published inode; a worker that immediately crashes therefore fails the transaction.

type YumManager

type YumManager struct {
	// contains filtered or unexported fields
}

YumManager manages packages using yum

func (*YumManager) Install

func (y *YumManager) Install(packages ...string) error

func (*YumManager) Remove

func (y *YumManager) Remove(packages ...string) error

func (*YumManager) Search

func (y *YumManager) Search(packageName string) (bool, error)

func (*YumManager) Update

func (y *YumManager) Update() error

type ZypperManager

type ZypperManager struct {
	// contains filtered or unexported fields
}

ZypperManager manages packages using zypper

func (*ZypperManager) Install

func (z *ZypperManager) Install(packages ...string) error

func (*ZypperManager) Remove

func (z *ZypperManager) Remove(packages ...string) error

func (*ZypperManager) Search

func (z *ZypperManager) Search(packageName string) (bool, error)

func (*ZypperManager) Update

func (z *ZypperManager) Update() error

Jump to

Keyboard shortcuts

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