config

package
v3.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: BSD-3-Clause Imports: 35 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LatestTalosVersion = "v1.12.4"

renovate: depName=siderolabs/talos datasource=github-releases

View Source
var OfficialExtensions = generateExtensionSchema(schemaFile)

Functions

func FromFile added in v3.0.3

func FromFile(path string) ([]byte, error)

FromFile is a wrapper for `os.ReadFile` with modified error if path doesn't exist.

func ValidateFromByte

func ValidateFromByte(source []byte) (Errors, Warnings, error)

func ValidateFromFile

func ValidateFromFile(path string) (Errors, Warnings, error)

Types

type ClusterInlineManifest added in v3.0.19

type ClusterInlineManifest struct {
	v1alpha1.ClusterInlineManifest `yaml:",inline"`
	SkipEnvsubst                   bool `yaml:"skipEnvsubst" jsonschema:"description=Whether to skip envsubst to the contents (only for contents in another file)"`
}

type ClusterInlineManifests added in v3.0.19

type ClusterInlineManifests []*ClusterInlineManifest

func (ClusterInlineManifests) GetIMs added in v3.0.19

type CustomizationWrapper added in v3.1.3

type CustomizationWrapper struct {
	ExtraKernelArgs  []string                          `yaml:"extraKernelArgs" jsonschema:"description=Extra kernel arguments to be passed to the kernel"`
	Meta             schematic.MetaValue               `yaml:"meta" jsonschema:"desciption=Initial META contents for the image"`
	SystemExtensions schematic.SystemExtensions        `yaml:"systemExtensions" jsonschema:"description=Talos system extensions to be installed"`
	Bootloader       string                            `yaml:"bootloader" jsonschema:"description=The bootloader to be used in the image,enum=sd-boot,enum=grub,enum=dual-boot"`
	SecureBoot       schematic.SecureBootCustomization `yaml:"secureboot" jsonschema:"description=The secure boot options for the image"`
}

type DiskSelectorWrapper added in v3.0.24

type DiskSelectorWrapper struct {
	Match string `yaml:"match" jsonschema:"description=The Common Expression Language (CEL) expression to match the disk"`
}

type Error

type Error struct {
	Kind    string
	Field   string
	Message error
}

type Errors

type Errors []*Error

func (*Errors) Append

func (errs *Errors) Append(err *Error) *Errors

func (Errors) HasField

func (errs Errors) HasField(field string) bool

type ExtensionService

type ExtensionService struct {
	Name        string                    `yaml:"name" jsonschema:"description=Name of the extension service config"`
	ConfigFiles extensions.ConfigFileList `yaml:"configFiles,omitempty" jsonschema:"description=The config files for the extension service"`
	Environment []string                  `yaml:"environment,omitempty" jsonschema:"description=The environment for the extension service"`
}

type FilesystemSpecWrapper added in v3.0.24

type FilesystemSpecWrapper struct {
	FilesystemType string `yaml:"type" jsonschema:"default=xfs,description=Filesystem type,enum=ext4,enum=xfs"`
}

type ImageFactory

type ImageFactory struct {
	RegistryURL       string `yaml:"registryURL,omitempty" jsonschema:"default=factory.talos.dev,description=Registry url or the image"`
	SchematicEndpoint string `` /* 126-byte string literal not displayed */
	Protocol          string `yaml:"protocol,omitempty" jsonschema:"default=https,description=Protocol of the registry(https or http)"`
	InstallerURLTmpl  string `` /* 183-byte string literal not displayed */
	ImageURLTmpl      string `` /* 263-byte string literal not displayed */
}

type IngressConfigWrapper

type IngressConfigWrapper struct {
	Subnet string `yaml:"subnet" jsonschema:"description=Source subnet"`
	Except string `yaml:"except" jsonschema:"description=Source subnet to exclude from the subnet"`
}

type IngressFirewall

type IngressFirewall struct {
	DefaultAction nethelpers.DefaultAction `` /* 126-byte string literal not displayed */
	NetworkRules  []NetworkRule            `yaml:"rules,omitempty" jsonschema:"description=List of matching network rules to allow or block against the defaultAction"`
}

func (IngressFirewall) JSONSchemaAlias

func (IngressFirewall) JSONSchemaAlias() any

type IngressFirewallWrapper

type IngressFirewallWrapper struct {
	DefaultAction string               `yaml:"defaultAction" jsonschema:"default=block,description=Default action for all not explicitly configured traffic"`
	NetworkRules  []NetworkRuleWrapper `yaml:"rules" jsonschema:"description=List of matching network rules to allow or block against the defaultAction"`
}

type InstallDiskSelectorWrapper

type InstallDiskSelectorWrapper struct {
	Size     string `yaml:"size" jsonschema:"description=Disk size,example=4GB"`
	Name     string `yaml:"name" jsonschema:"Disk name"`
	Model    string `yaml:"model" jsonschema:"Disk model"`
	Serial   string `yaml:"serial" jsonschema:"Disk serial number"`
	Modalias string `yaml:"modalias" jsonschema:"Disk modalias"`
	UUID     string `yaml:"uuid" jsonschema:"Disk UUID"`
	WWID     string `yaml:"wwid" jsonschema:"Disk WWID"`
	Type     string `yaml:"type" jsonschema:"Disk type,example=ssd"`
	BusPath  string `yaml:"busPath" jsonschema:"Disk bus path"`
}

type MachineFile added in v3.0.19

type MachineFile struct {
	v1alpha1.MachineFile `yaml:",inline"`
	SkipEnvsubst         bool `yaml:"skipEnvsubst" jsonschema:"description=Whether to skip envsubst to the contents (only for contents in another file)"`
}

type MachineFiles added in v3.0.19

type MachineFiles []*MachineFile

func (MachineFiles) GetMFs added in v3.0.19

func (mfs MachineFiles) GetMFs() []*v1alpha1.MachineFile

type MachineSpec

type MachineSpec struct {
	Mode        string `yaml:"mode,omitempty" jsonschema:"default=metal,description=Machine mode (e.g: metal)"`
	Arch        string `yaml:"arch,omitempty" jsonschema:"default=amd64,description=Machine architecture (e.g: amd64, arm64)"`
	Secureboot  bool   `yaml:"secureboot,omitempty" jsonschema:"default=false,description=Whether to enable Secure Boot"`
	UseUKI      bool   `yaml:"useUKI,omitempty" jsonschema:"default=false,description=Whether to use UKI if Secure Boot is enabled"`
	BootMethod  string `yaml:"bootMethod,omitempty" jsonschema:"default=iso,description=Boot method of the node (can be disk-image, iso, or pxe)"`
	ImageSuffix string `` /* 170-byte string literal not displayed */
}

type NetworkRule

type NetworkRule struct {
	Name         string                   `yaml:"name" jsonschema:"description=Name of the rule"`
	PortSelector network.RulePortSelector `yaml:"portSelector" jsonschema:"description=Ports and protocols on the host affected by the rule"`
	Ingress      network.IngressConfig    `yaml:"ingress" jsonschema:"description=List of source subnets allowed to access the host ports/protocols"`
}

type NetworkRuleWrapper

type NetworkRuleWrapper struct {
	Name         string                 `yaml:"name" jsonschema:"description=Name of the rule"`
	PortSelector PortSelectorWrapper    `yaml:"portSelector" jsonschema:"description=Ports and protocols on the host affected by the rule"`
	Ingress      []IngressConfigWrapper `yaml:"ingress" jsonschema:"description=List of source subnets allowed to access the host ports/protocols"`
}

type Node

type Node struct {
	Hostname                string                        `yaml:"hostname" jsonschema:"required,description=Hostname of the node"`
	IPAddress               string                        `` /* 168-byte string literal not displayed */
	ControlPlane            bool                          `yaml:"controlPlane" jsonschema:"description=Whether the node is a controlplane"`
	InstallDisk             string                        `yaml:"installDisk,omitempty" jsonschema:"oneof_required=installDiskSelector,description=The disk used for installation"`
	InstallDiskSelector     *v1alpha1.InstallDiskSelector `yaml:"installDiskSelector,omitempty" jsonschema:"oneof_required=installDisk,description=Look up disk used for installation"`
	IgnoreHostname          bool                          `yaml:"ignoreHostname" jsonschema:"description=Whether to set \"machine.network.hostname\" to the generated config file"`
	OverridePatches         bool                          `` /* 136-byte string literal not displayed */
	OverrideExtraManifests  bool                          `` /* 150-byte string literal not displayed */
	OverrideMachineCertSANs bool                          `` /* 145-byte string literal not displayed */
	NodeConfigs             `yaml:",inline" jsonschema:"description=Node specific configurations that will override node group configurations"`
}

func (*Node) ContainsIP

func (n *Node) ContainsIP(ip string) bool

ContainsIP returns true if `n.IPAddress` contains `ip`

func (*Node) GetFilenameTmpl added in v3.0.24

func (n *Node) GetFilenameTmpl() string

func (*Node) GetIPAddresses

func (n *Node) GetIPAddresses() []string

GetIPAddresses returns list of IPaddresses

func (*Node) GetMachineSpec

func (n *Node) GetMachineSpec() *MachineSpec

GetMachineSpec returns default `MachineSpec` for `Node` if not specified.

func (*Node) GetOutputFileName added in v3.0.24

func (n *Node) GetOutputFileName(c *TalhelperConfig) (string, error)

func (Node) JSONSchemaProperty

func (Node) JSONSchemaProperty(prop string) any

func (*Node) OverrideGlobalCfg

func (node *Node) OverrideGlobalCfg(cfg NodeConfigs) *Node

type NodeConfigs

type NodeConfigs struct {
	NodeLabels          map[string]string              `yaml:"nodeLabels" jsonschema:"description=Labels to be added to the node, supports templating"`
	NodeAnnotations     map[string]string              `yaml:"nodeAnnotations" jsonschema:"description=Annotations to be added to the node, supports templating"`
	NodeTaints          map[string]string              `yaml:"nodeTaints" jsonschema:"description=Node taints for the node. Effect is optional"`
	MachineDisks        []*v1alpha1.MachineDisk        `yaml:"machineDisks,omitempty" jsonschema:"description=DEPRECATED: user \"userVolumes\" instead"`
	MachineFiles        MachineFiles                   `yaml:"machineFiles,omitempty" jsonschema:"description=List of files to create inside the node"`
	DisableSearchDomain bool                           `yaml:"disableSearchDomain,omitempty" jsonschema:"description=Whether to disable generating default search domain"`
	KernelModules       []*v1alpha1.KernelModuleConfig `yaml:"kernelModules,omitempty" jsonschema:"description=List of additional kernel modules to load inside the node"`
	Nameservers         []string                       `yaml:"nameservers,omitempty" jsonschema:"description=List of nameservers for the node"`
	NetworkInterfaces   []*v1alpha1.Device             `yaml:"networkInterfaces,omitempty" jsonschema:"description=List of network interface configuration for the node"`
	ExtraManifests      []string                       `yaml:"extraManifests,omitempty" jsonschema:"description=DEPRECATED: Use \"patches\" instead"`
	CertSANs            []string                       `yaml:"certSANs,omitempty" jsonschema:"description=Additional certificate SANs to add to the machine certificate"`
	Patches             []string                       `yaml:"patches,omitempty" jsonschema:"description=Patches to be applied to the node"`
	TalosImageURL       string                         `` /* 185-byte string literal not displayed */
	NoSchematicValidate bool                           `yaml:"noSchematicValidate" jsonschema:"description=Whether to skip schematic validation"`
	Schematic           *schematic.Schematic           `yaml:"schematic,omitempty" jsonschema:"description=Talos image customization to be used in the installer image"`
	ImageSchematic      *schematic.Schematic           `yaml:"imageSchematic,omitempty" jsonschema:"description=Talos image customization to be used for ISO or boot image"`
	MachineSpec         MachineSpec                    `yaml:"machineSpec,omitempty" jsonschema:"description=Machine hardware specification"`
	IngressFirewall     *IngressFirewall               `yaml:"ingressFirewall,omitempty" jsonschema:"description=Machine firewall specification"`
	ExtensionServices   []*ExtensionService            `yaml:"extensionServices,omitempty" jsonschema:"description=Machine extension services specification"`
	Volumes             []*Volume                      `yaml:"volumes,omitempty" jsonschema:"description=Machine volume configs specification"`
	UserVolumes         []*UserVolume                  `yaml:"userVolumes,omitempty" jsonschema:"description=Machine user volume configs specification"`
	FilenameTmpl        string                         `yaml:"filenameTmpl" jsonschema:"default={{.ClusterName}}-{{Hostname}}.yaml,description=Template for the generated filename"`
}

func (NodeConfigs) JSONSchemaProperty added in v3.1.3

func (NodeConfigs) JSONSchemaProperty(prop string) any

type PortSelectorWrapper

type PortSelectorWrapper struct {
	Ports    []any  `yaml:"ports" jsonschema:"description=List of ports or port ranges"`
	Protocol string `yaml:"protocol" jsonschema:"description=Protocol (can be tcp or udp)"`
}

type ProvisioningSpecWrapper added in v3.0.24

type ProvisioningSpecWrapper struct {
	DiskSelectorSpec    DiskSelectorWrapper `yaml:"diskSelector" jsonschema:"description=The disk selector expression"`
	ProvisioningGrow    bool                `yaml:"grow" jsonschema:"description=Should the volume grow to the size of the disk (if possible)"`
	ProvisioningMinSize string              `yaml:"minSize" jsonschema:"description=The minimum size of the volume,example=2.5GiB"`
	ProvisioningMaxSize string              `` /* 146-byte string literal not displayed */
}

type SchematicWrapper added in v3.1.3

type SchematicWrapper struct {
	Overlay       schematic.Overlay    `yaml:"overlay" jsonschema:"description=The overlay options for image generation"`
	Customization CustomizationWrapper `yaml:"customization" jsonschema:"description=Talos image customization"`
}

type TalhelperConfig

type TalhelperConfig struct {
	ClusterName                    string                 `yaml:"clusterName" jsonschema:"required,description=Name of the cluster"`
	TalosVersion                   string                 `yaml:"talosVersion,omitempty" jsonschema:"example=v1.5.4,description=Talos version to perform installation"`
	KubernetesVersion              string                 `yaml:"kubernetesVersion,omitempty" jsonschema:"example=v1.27.0,description=Kubernetes version to use"`
	Endpoint                       string                 `yaml:"endpoint" jsonschema:"required,example=https://192.168.200.10:6443,description=Cluster's controlplane endpoint"`
	Domain                         string                 `yaml:"domain,omitempty" jsonschema:"example=cluster.local,description=The domain to be used by Kubernetes DNS"`
	AllowSchedulingOnMasters       bool                   `yaml:"allowSchedulingOnMasters,omitempty" jsonschema:"description=Whether to allow running workload on controlplane nodes"`
	AllowSchedulingOnControlPlanes bool                   `` /* 176-byte string literal not displayed */
	AdditionalMachineCertSans      []string               `` /* 175-byte string literal not displayed */
	AdditionalApiServerCertSans    []string               `yaml:"additionalApiServerCertSans,omitempty" jsonschema:"description=Extra certificate SANs for the API server's certificate"`
	ClusterInlineManifests         ClusterInlineManifests `yaml:"inlineManifests,omitempty" jsonschema:"description=A list of inline Kubernetes manifests for the cluster"`
	ClusterPodNets                 []string               `yaml:"clusterPodNets,omitempty" jsonschema:"description=The pod subnet CIDR list"`
	ClusterSvcNets                 []string               `yaml:"clusterSvcNets,omitempty" jsonschema:"description=The service subnet CIDR list"`
	CNIConfig                      *v1alpha1.CNIConfig    `yaml:"cniConfig,omitempty" jsonschema:"description=The CNI to be used for the cluster's network"`
	Patches                        []string               `yaml:"patches,omitempty" jsonschema:"description=Patches to be applied to all nodes"`
	Nodes                          []Node                 `yaml:"nodes" jsonschema:"required,description=List of configurations for Node"`
	ImageFactory                   ImageFactory           `yaml:"imageFactory,omitempty" jsonschema:"Configuration for image factory"`
	ControlPlane                   NodeConfigs            `yaml:"controlPlane,omitempty" jsonschema:"description=Configurations targetted for all controlplane nodes"`
	Worker                         NodeConfigs            `yaml:"worker,omitempty" jsonschema:"description=Configurations targetted for all worker nodes"`
}

func LoadAndValidateFromFile

func LoadAndValidateFromFile(filePath string, envPaths []string, showWarns bool) (*TalhelperConfig, error)

LoadAndValidateFromFile takes a file path and yaml encoded env files path, do envsubst from envPaths. The resulted TalhelperConfig will be validated before being returned. It returns an error, if any.

func NewFromByte

func NewFromByte(source []byte) (*TalhelperConfig, error)

NewFromByte takes bytes and convert it into Talhelper config. It also returns an error, if any.

func NewFromFile

func NewFromFile(path string) (c *TalhelperConfig, err error)

NewFromFile takes a file path and convert the contents into Talhelper config. It also returns an error, if any.

func (*TalhelperConfig) ApplyInlinePatch

func (c *TalhelperConfig) ApplyInlinePatch(patch []byte) ([]byte, error)

func (*TalhelperConfig) Encode

func (c *TalhelperConfig) Encode(cfg []byte) ([]byte, error)

Encode encodes Talhelper config into yaml bytes. It also returns an error, if any.

func (*TalhelperConfig) GenerateGitignore

func (config *TalhelperConfig) GenerateGitignore(outputDir string) error

GenerateGitignore generates `.gitignore` file in the specified path. It returns an error, if any.

func (*TalhelperConfig) GetClusterPodNets

func (c *TalhelperConfig) GetClusterPodNets() []string

GetClusterPodNets returns `ClusterPodNets` strings.

func (*TalhelperConfig) GetClusterSvcNets

func (c *TalhelperConfig) GetClusterSvcNets() []string

GetClusterSvcNets returns `ClusterSvcNets` strings.

func (*TalhelperConfig) GetImageFactory

func (c *TalhelperConfig) GetImageFactory() *ImageFactory

GetImageFactory returns default `imageFactory` if not specified.

func (*TalhelperConfig) GetK8sVersion

func (c *TalhelperConfig) GetK8sVersion() string

GetK8sVersion returns Kubernetes version string without `v` prefix.

func (*TalhelperConfig) GetTalosVersion

func (c *TalhelperConfig) GetTalosVersion() string

GetTalosVersion returns Talos version string prefixed with `v`.

func (TalhelperConfig) Validate

func (c TalhelperConfig) Validate() (Errors, Warnings)

Validate returns `Errors` and `Warnings` if the given `TalhelperConfig` is not correct

type UserVolume added in v3.0.22

type UserVolume struct {
	Name         string                 `yaml:"name" jsonschema:"description=Name of user volume config"`
	VolumeType   *block.VolumeType      `yaml:"volumeType" jsonschema:"description=Volume type of user volume config"`
	Provisioning block.ProvisioningSpec `yaml:"provisioning" jsonschema:"description=Provisioning spec of the user volume config"`
	Filesystem   block.FilesystemSpec   `yaml:"filesystem" jsonschema:"description=Filesystem spec of the user volume config"`
	Encryption   block.EncryptionSpec   `yaml:"encryption" jsonschema:"description=Encryption spec of the user volume config"`
}

func (UserVolume) JSONSchemaProperty added in v3.0.24

func (UserVolume) JSONSchemaProperty(prop string) any

type Volume added in v3.0.15

type Volume struct {
	Name         string                 `yaml:"name" jsonschema:"description=Name of the volume config"`
	Provisioning block.ProvisioningSpec `yaml:"provisioning" jsonschema:"description=Provisioning spec of the volume config"`
	Encryption   block.EncryptionSpec   `yaml:"encryption" jsonschema:"description=Encryption spec of the volume config"`
}

func (Volume) JSONSchemaProperty added in v3.0.24

func (Volume) JSONSchemaProperty(prop string) any

type Warning

type Warning struct {
	Kind    string
	Field   string
	Message string
}

type Warnings

type Warnings []*Warning

func (*Warnings) Append

func (warns *Warnings) Append(warn *Warning) *Warnings

func (Warnings) HasField

func (warns Warnings) HasField(field string) bool

Directories

Path Synopsis
schemas

Jump to

Keyboard shortcuts

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