config

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "v0.5.0"

Version is the current version of herd. Version is the current version of herd.

Variables

This section is empty.

Functions

func GetTargetHomeDir added in v0.5.1

func GetTargetHomeDir() (string, error)

GetTargetHomeDir returns the home directory of the original user if running under sudo, falling back to the current user's home directory.

Types

type BinaryConfig added in v0.5.0

type BinaryConfig struct {
	FirecrackerPath string `yaml:"firecracker_path"`
	JailerPath      string `yaml:"jailer_path"`
	KernelImagePath string `yaml:"kernel_image_path"`
	GuestAgentPath  string `yaml:"guest_agent_path"`
}

type CloudConfig added in v0.5.4

type CloudConfig struct {
	Enabled  bool   `yaml:"enabled"`
	Endpoint string `yaml:"endpoint"`
	NodeID   string `yaml:"node_id"`
}

type Config

type Config struct {
	Network   NetworkConfig   `yaml:"network"`
	Storage   StorageConfig   `yaml:"storage"`
	Resources ResourceConfig  `yaml:"resources"`
	Binaries  BinaryConfig    `yaml:"binaries"`
	Jailer    JailerConfig    `yaml:"jailer"`
	Telemetry TelemetryConfig `yaml:"telemetry"`
	Cloud     CloudConfig     `yaml:"cloud"`
}

Config is the strict daemon bootstrap contract. The daemon fails fast if any required field is missing or malformed.

func Load

func Load(path string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type JailerConfig added in v0.5.4

type JailerConfig struct {
	// UIDPoolStart is the first UID (and GID) in the pool. Must be >= 65536 to
	// stay well above system-reserved UIDs. Recommended: 300000.
	UIDPoolStart int `yaml:"uid_pool_start"`
	// UIDPoolSize is how many concurrent MicroVMs the pool can support.
	// Set this to at least your max_global_vms value.
	UIDPoolSize   int    `yaml:"uid_pool_size"`
	ChrootBaseDir string `yaml:"chroot_base_dir"`
}

JailerConfig holds parameters for the Firecracker jailer process.

Each concurrent MicroVM is assigned a unique UID/GID leased from the pool [UIDPoolStart, UIDPoolStart+UIDPoolSize). This ensures every tenant runs in a distinct DAC security domain — a requirement for multi-tenant public cloud deployments where different tenants share the same bare-metal host.

type NetworkConfig

type NetworkConfig struct {
	ControlBind string `yaml:"control_bind"`
	DataBind    string `yaml:"data_bind"`
}

type ResourceConfig

type ResourceConfig struct {
	MaxGlobalVMs      int     `yaml:"max_global_vms"`
	MaxGlobalMemoryMB int64   `yaml:"max_global_memory_mb"`
	CPULimitCores     float64 `yaml:"cpu_limit_cores"`
}

func (ResourceConfig) MemoryLimitBytes

func (r ResourceConfig) MemoryLimitBytes() int64

type StorageConfig added in v0.5.0

type StorageConfig struct {
	StateDir        string `yaml:"state_dir"`
	SnapshotterName string `yaml:"snapshotter_name"`
	Namespace       string `yaml:"namespace"`
}

type TelemetryConfig

type TelemetryConfig struct {
	LogFormat   string `yaml:"log_format"`
	MetricsPath string `yaml:"metrics_path"`
}

Jump to

Keyboard shortcuts

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