Documentation
¶
Index ¶
- Variables
- func FromFile(path string) ([]byte, error)
- func ValidateFromByte(source []byte) (Errors, Warnings, error)
- func ValidateFromFile(path string) (Errors, Warnings, error)
- type ClusterInlineManifest
- type ClusterInlineManifests
- type CustomizationWrapper
- type DiskSelectorWrapper
- type Error
- type Errors
- type ExtensionService
- type FilesystemSpecWrapper
- type ImageFactory
- type IngressConfigWrapper
- type IngressFirewall
- type IngressFirewallWrapper
- type InstallDiskSelectorWrapper
- type MachineFile
- type MachineFiles
- type MachineSpec
- type NetworkRule
- type NetworkRuleWrapper
- type Node
- func (n *Node) ContainsIP(ip string) bool
- func (n *Node) GetFilenameTmpl() string
- func (n *Node) GetIPAddresses() []string
- func (n *Node) GetMachineSpec() *MachineSpec
- func (n *Node) GetOutputFileName(c *TalhelperConfig) (string, error)
- func (Node) JSONSchemaProperty(prop string) any
- func (node *Node) OverrideGlobalCfg(cfg NodeConfigs) *Node
- type NodeConfigs
- type PortSelectorWrapper
- type ProvisioningSpecWrapper
- type SchematicWrapper
- 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 UserVolume
- type Volume
- type Warning
- type Warnings
Constants ¶
This section is empty.
Variables ¶
var LatestTalosVersion = "v1.12.4"
renovate: depName=siderolabs/talos datasource=github-releases
var OfficialExtensions = generateExtensionSchema(schemaFile)
Functions ¶
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
func (cims ClusterInlineManifests) GetIMs() *v1alpha1.ClusterInlineManifests
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 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 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 ¶
ContainsIP returns true if `n.IPAddress` contains `ip`
func (*Node) GetFilenameTmpl ¶ added in v3.0.24
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) GetOutputFileName ¶ added in v3.0.24
func (n *Node) GetOutputFileName(c *TalhelperConfig) (string, error)
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=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 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"`
}