config

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LatestTalosVersion = "v1.6.2"

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

View Source
var OfficialExtensions = generateExtensionSchema(schemaFile)

Functions

func ValidateFromByte added in v1.13.0

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

func ValidateFromFile added in v1.13.0

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

Types

type Error added in v1.13.0

type Error struct {
	Kind    string
	Field   string
	Message error
}

type Errors added in v1.13.0

type Errors []*Error

func (*Errors) Append added in v1.13.0

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

func (Errors) HasField added in v1.13.0

func (errs Errors) HasField(field string) bool

type ImageFactory added in v1.16.0

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 `` /* 147-byte string literal not displayed */
	ISOURLTmpl        string `` /* 171-byte string literal not displayed */
}

type IngressConfigWrapper added in v1.17.0

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 added in v1.17.0

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 added in v1.17.0

func (IngressFirewall) JSONSchemaAlias() any

type IngressFirewallWrapper added in v1.17.0

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 added in v1.15.0

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 added in v1.16.0

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)"`
}

type NetworkRule added in v1.17.0

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 added in v1.17.0

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 added in v1.13.0

type Node struct {
	Hostname            string                            `yaml:"hostname" jsonschema:"required,description=Hostname of the node"`
	IPAddress           string                            `yaml:"ipAddress,omitempty" jsonschema:"required,example=192.168.200.11,description=IP address where the node can be reached"`
	ControlPlane        bool                              `yaml:"controlPlane" jsonschema:"description=Whether the node is a controlplane"`
	NodeLabels          map[string]string                 `yaml:"nodeLabels" jsonschema:"description=Labels to be added to the node"`
	NodeTaints          map[string]string                 `yaml:"nodeTaints" jsonschema:"description=Node taints for the node. Effect is optional"`
	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"`
	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"`
	Extensions          []v1alpha1.InstallExtensionConfig `yaml:"extensions,omitempty" jsonschema:"description=DEPRECATED: use \"schematic\" instead"`
	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"`
	ConfigPatches       []map[string]interface{}          `yaml:"configPatches,omitempty" jsonschema:"description=DEPRECATED: use \"patches\" instead"`
	InlinePatch         map[string]interface{}            `yaml:"inlinePatch,omitempty" jsonschema:"description=DEPRECATED: use \"patches\" instead"`
	Patches             []string                          `yaml:"patches,omitempty" jsonschema:"description=Patches to be applied to the node"`
	TalosImageURL       string                            `` /* 185-byte string literal not displayed */
	Schematic           *schematic.Schematic              `yaml:"schematic,omitempty" jsonschema:"description=Talos image customization to be used in the installer image"`
	MachineSpec         MachineSpec                       `yaml:"machineSpec,omitempty" jsonschema:"description=Machine hardware specification"`
	IngressFirewall     *IngressFirewall                  `yaml:"ingressFirewall,omitempty" jsonschema:"description=Machine firewall specification"`
}

func (*Node) GetMachineSpec added in v1.16.0

func (n *Node) GetMachineSpec() *MachineSpec

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

func (Node) JSONSchemaProperty added in v1.15.0

func (Node) JSONSchemaProperty(prop string) any

type PortSelectorWrapper added in v1.17.0

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 TalhelperConfig

type TalhelperConfig struct {
	ClusterName                    string              `yaml:"clusterName" jsonschema:"required,description=Name of the cluster"`
	TalosImageURL                  string              `` /* 154-byte string literal not displayed */
	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                   controlPlane        `yaml:"controlPlane,omitempty" jsonschema:"description=Configurations targetted for controlplane nodes"`
	Worker                         worker              `yaml:"worker,omitempty" jsonschema:"description=Configurations targetted for worker nodes"`
}

func LoadAndValidateFromFile added in v1.16.0

func LoadAndValidateFromFile(filePath string, envPaths []string) (*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 added in v1.13.0

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

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

func NewFromFile added in v1.13.0

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 added in v1.2.0

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

func (*TalhelperConfig) Encode added in v1.2.0

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 added in v1.2.0

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

GetClusterPodNets returns `ClusterPodNets` strings.

func (*TalhelperConfig) GetClusterSvcNets added in v1.2.0

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

GetClusterSvcNets returns `ClusterSvcNets` strings.

func (*TalhelperConfig) GetImageFactory added in v1.16.0

func (c *TalhelperConfig) GetImageFactory() *ImageFactory

GetImageFactory returns default `imageFactory` if not specified.

func (*TalhelperConfig) GetInstallerURL added in v1.2.0

func (c *TalhelperConfig) GetInstallerURL() string

GetInstallerURL returns installer URL string.

func (*TalhelperConfig) GetK8sVersion added in v1.2.0

func (c *TalhelperConfig) GetK8sVersion() string

GetK8sVersion returns Kubernetes version string without `v` prefix.

func (*TalhelperConfig) GetTalosVersion added in v1.2.0

func (c *TalhelperConfig) GetTalosVersion() string

GetTalosVersion returns Talos version string prefixed with `v`.

func (TalhelperConfig) Validate added in v1.13.0

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

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

type Warning added in v1.15.0

type Warning struct {
	Kind    string
	Field   string
	Message string
}

type Warnings added in v1.15.0

type Warnings []*Warning

func (*Warnings) Append added in v1.15.0

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

func (Warnings) HasField added in v1.15.0

func (warns Warnings) HasField(field string) bool

Jump to

Keyboard shortcuts

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