Documentation ¶
Index ¶
- Variables
- func FromFile(path string) ([]byte, error)
- func ValidateFromByte(source []byte) (Errors, Warnings, error)
- func ValidateFromFile(path string) (Errors, Warnings, error)
- type Error
- type Errors
- type ExtensionService
- type ImageFactory
- type IngressConfigWrapper
- type IngressFirewall
- type IngressFirewallWrapper
- type InstallDiskSelectorWrapper
- type MachineSpec
- type NetworkRule
- type NetworkRuleWrapper
- type Node
- type NodeConfigs
- type PortSelectorWrapper
- type TalhelperConfig
- func (c *TalhelperConfig) ApplyInlinePatch(patch []byte) ([]byte, error)
- func (c *TalhelperConfig) Encode(cfg []byte) ([]byte, error)
- func (config *TalhelperConfig) GenerateGitignore(outputDir string) error
- func (c *TalhelperConfig) GetClusterPodNets() []string
- func (c *TalhelperConfig) GetClusterSvcNets() []string
- func (c *TalhelperConfig) GetImageFactory() *ImageFactory
- func (c *TalhelperConfig) GetK8sVersion() string
- func (c *TalhelperConfig) GetTalosVersion() string
- func (c TalhelperConfig) Validate() (Errors, Warnings)
- type Warning
- type Warnings
Constants ¶
This section is empty.
Variables ¶
var LatestTalosVersion = "v1.9.1"
renovate: depName=siderolabs/talos datasource=github-releases
var OfficialExtensions = generateExtensionSchema(schemaFile)
Functions ¶
Types ¶
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 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 */ ISOURLTmpl string `` /* 260-byte string literal not displayed */ }
type IngressConfigWrapper ¶
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 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"` }
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 */ NodeConfigs `yaml:",inline" jsonschema:"description=Node specific configurations that will override node group configurations"` }
func (*Node) ContainsIP ¶
ContainsIP returns true if `n.IPAddress` contains `ip`
func (*Node) GetIPAddresses ¶
GetIPAddresses returns list of IPaddresses
func (*Node) GetMachineSpec ¶
func (n *Node) GetMachineSpec() *MachineSpec
GetMachineSpec returns default `MachineSpec` for `Node` if not specified.
func (Node) JSONSchemaProperty ¶
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=List of additional disks to partition, format, mount"` MachineFiles []*v1alpha1.MachineFile `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=List of manifest files to be added to the node"` 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"` IsoSchematic *schematic.Schematic `yaml:"isoSchematic,omitempty" jsonschema:"description=Talos image customization to be used for ISO 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"` }
type PortSelectorWrapper ¶
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 `yaml:"additionalMachineCertSans,omitempty" jsonschema:"description=Extra certificate SANs for the machine's certificate"` AdditionalApiServerCertSans []string `yaml:"additionalApiServerCertSans,omitempty" jsonschema:"description=Extra certificate SANs for the API server's certificate"` 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