Documentation
¶
Overview ¶
Package provision provides abstract definitions for Talos cluster provisioners.
Index ¶
- type CNIConfig
- type Cluster
- type ClusterInfo
- type ClusterRequest
- type ConfigInjectionMethod
- type Disk
- type NetworkInfo
- type NetworkRequest
- type NodeInfo
- type NodeRequest
- type NodeRequests
- type Option
- func WithBootlader(enabled bool) Option
- func WithDebugShell(enabled bool) Option
- func WithDeleteOnErr(v bool) Option
- func WithDockerPorts(ports []string) Option
- func WithDockerPortsHostIP(hostIP string) Option
- func WithExtraUEFISearchPaths(extraUEFISearchPaths []string) Option
- func WithIOMMU(enabled bool) Option
- func WithJSONLogs(endpoint string) Option
- func WithKMS(endpoint string) Option
- func WithKubernetesEndpoint(endpoint string) Option
- func WithLogWriter(w io.Writer) Option
- func WithSaveClusterLogsArchivePath(path string) Option
- func WithSaveSupportArchivePath(path string) Option
- func WithSiderolinkAgent(v bool) Option
- func WithTPM2(enabled bool) Option
- func WithTalosClient(client *client.Client) Option
- func WithTalosConfig(talosConfig *clientconfig.Config) Option
- func WithTargetArch(arch string) Option
- func WithUEFI(enabled bool) Option
- type Options
- type Provisioner
- type SiderolinkBind
- type SiderolinkRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster interface {
// Provisioner returns name of the provisioner used to build the cluster.
Provisioner() string
// StatePath returns path to the state directory of the cluster.
StatePath() (string, error)
// Info returns running cluster information.
Info() ClusterInfo
}
Cluster describes the provisioned Cluster.
type ClusterInfo ¶
type ClusterInfo struct {
ClusterName string
Network NetworkInfo
Nodes []NodeInfo
// ExtraNodes are not part of the cluster.
ExtraNodes []NodeInfo
// KubernetesEndpoint is the endpoint of the Kubernetes API server.
KubernetesEndpoint string
}
ClusterInfo describes the cluster.
type ClusterRequest ¶
type ClusterRequest struct {
Name string
Network NetworkRequest
Nodes NodeRequests
// Docker specific parameters.
Image string
// Boot options (QEMU).
KernelPath string
InitramfsPath string
ISOPath string
USBPath string
UKIPath string
DiskImagePath string
IPXEBootScript string
// Encryption
KMSEndpoint string
// Path to talosctl executable to re-execute itself as needed.
SelfExecutable string
// Path to root of state directory (~/.talos/clusters by default).
StateDirectory string
SiderolinkRequest SiderolinkRequest
}
ClusterRequest is the root object describing cluster to be provisioned.
type ConfigInjectionMethod ¶ added in v1.8.2
type ConfigInjectionMethod int
ConfigInjectionMethod describes how to inject configuration into the node.
const ( // ConfigInjectionMethodHTTP injects configuration via HTTP. ConfigInjectionMethodHTTP ConfigInjectionMethod = iota // ConfigInjectionMethodMetalISO injects configuration via Metal ISO. ConfigInjectionMethodMetalISO )
type Disk ¶
type Disk struct {
// Size in bytes.
Size uint64
// Whether to skip preallocating the disk space.
SkipPreallocate bool
// Driver for the disk.
//
// Supported types: "virtio", "ide", "ahci", "scsi", "nvme", "megaraid".
Driver string
// Block size for the disk, defaults to 512 if not set.
BlockSize uint
}
Disk represents a disk size and name in NodeRequest.
type NetworkInfo ¶
type NetworkInfo struct {
Name string
CIDRs []netip.Prefix
GatewayAddrs []netip.Addr
MTU int
NoMasqueradeCIDRs []netip.Prefix
}
NetworkInfo describes cluster network.
type NetworkRequest ¶
type NetworkRequest struct {
Name string
CIDRs []netip.Prefix
NoMasqueradeCIDRs []netip.Prefix
GatewayAddrs []netip.Addr
MTU int
Nameservers []netip.Addr
LoadBalancerPorts []int
// CNI-specific parameters.
CNI CNIConfig
// DHCP options
DHCPSkipHostname bool
// Docker-specific parameters.
DockerDisableIPv6 bool
// Network chaos parameters.
NetworkChaos bool
Jitter time.Duration
Latency time.Duration
PacketLoss float64
PacketReorder float64
PacketCorrupt float64
Bandwidth int
}
NetworkRequest describes cluster network.
type NodeInfo ¶
type NodeInfo struct {
ID string
UUID uuid.UUID
Name string
Type machine.Type
// Share of CPUs, in 1e-9 fractions
NanoCPUs int64
// Memory limit in bytes
Memory int64
// Disk (volume) size in bytes, if applicable
DiskSize uint64
IPs []netip.Addr
APIPort int
TPM2StateDir string
}
NodeInfo describes a node.
type NodeRequest ¶
type NodeRequest struct {
Name string
IPs []netip.Addr
Type machine.Type
Quirks quirks.Quirks
Config config.Provider
ConfigInjectionMethod ConfigInjectionMethod
// Share of CPUs, in 1e-9 fractions
NanoCPUs int64
// Memory limit in bytes
Memory int64
// Disks (volumes), if applicable (VM only)
Disks []*Disk
// Mounts (containers only)
Mounts []mounttypes.Mount
// Ports
Ports []string
// SkipInjectingConfig disables reading configuration from http server
SkipInjectingConfig bool
// DefaultBootOrder overrides default boot order "cn" (disk, then network boot).
//
// BootOrder can be forced to be "nc" (PXE boot) via the API in QEMU provisioner.
DefaultBootOrder string
// ExtraKernelArgs passes additional kernel args
// to the initial boot from initramfs and vmlinuz.
//
// This doesn't apply to boots from ISO or from the disk image.
ExtraKernelArgs *procfs.Cmdline
// UUID allows to specify the UUID of the node (VMs only).
//
// If not specified, a random UUID will be generated.
UUID *uuid.UUID
// BadRTC resets RTC to well known time in the past (QEMU provisioner).
BadRTC bool
// PXE-booted VMs
PXEBooted bool
TFTPServer string
IPXEBootFilename string
}
NodeRequest describes a request for a node.
type NodeRequests ¶
type NodeRequests []NodeRequest
NodeRequests is a list of NodeRequest.
func (NodeRequests) ControlPlaneNodes ¶
func (reqs NodeRequests) ControlPlaneNodes() (nodes []NodeRequest)
ControlPlaneNodes returns subset of nodes which are Init/ControlPlane type.
func (NodeRequests) FindInitNode ¶
func (reqs NodeRequests) FindInitNode() (req NodeRequest, err error)
FindInitNode looks up init node, it returns an error if no init node is present or if it's duplicate.
func (NodeRequests) PXENodes ¶
func (reqs NodeRequests) PXENodes() (nodes []NodeRequest)
PXENodes returns subset of nodes which are PXE booted.
func (NodeRequests) WorkerNodes ¶
func (reqs NodeRequests) WorkerNodes() (nodes []NodeRequest)
WorkerNodes returns subset of nodes which are Init/ControlPlane type.
type Option ¶
Option controls Provisioner.
func WithBootlader ¶
WithBootlader enables or disables bootloader (bootloader is enabled by default).
func WithDebugShell ¶ added in v1.9.0
WithDebugShell drops into debug shell in initramfs.
func WithDeleteOnErr ¶
WithDeleteOnErr informs the provisioner to delete cluster state folder on error.
func WithDockerPorts ¶
WithDockerPorts allows docker provisioner to expose ports on workers.
func WithDockerPortsHostIP ¶
WithDockerPortsHostIP sets host IP for docker provisioner to expose ports on workers.
func WithExtraUEFISearchPaths ¶
WithExtraUEFISearchPaths configures additional search paths to look for UEFI firmware.
func WithJSONLogs ¶ added in v1.9.0
WithJSONLogs specifies endpoint to send logs in JSON format.
func WithKubernetesEndpoint ¶ added in v1.7.0
WithKubernetesEndpoint specifies full external Kubernetes API endpoint to use when accessing Talos cluster.
func WithSaveClusterLogsArchivePath ¶ added in v1.9.0
WithSaveClusterLogsArchivePath specifies path to save cluster logs archive on destroy.
func WithSaveSupportArchivePath ¶ added in v1.9.0
WithSaveSupportArchivePath specifies path to save support archive on destroy.
func WithSiderolinkAgent ¶ added in v1.7.0
WithSiderolinkAgent enables or disables siderolink agent.
func WithTalosClient ¶
WithTalosClient specifies client to use when acessing Talos cluster.
func WithTalosConfig ¶
func WithTalosConfig(talosConfig *clientconfig.Config) Option
WithTalosConfig specifies talosconfig to use when acessing Talos cluster.
func WithTargetArch ¶
WithTargetArch specifies target architecture for the cluster.
type Options ¶
type Options struct {
LogWriter io.Writer
TalosConfig *clientconfig.Config
TalosClient *client.Client
KubernetesEndpoint string
TargetArch string
// Enable bootloader by booting from disk image after install.
BootloaderEnabled bool
// Enable UEFI (for amd64), arm64 can only boot UEFI
UEFIEnabled bool
// Enable TPM2 emulation using swtpm.
TPM2Enabled bool
// Enable debug shell in the bootloader.
WithDebugShell bool
// Enable IOMMU for VMs and add a new PCI root controller and network interface.
IOMMUEnabled bool
// Configure additional search paths to look for UEFI firmware.
ExtraUEFISearchPaths []string
// Expose ports to worker machines in docker provisioner
DockerPorts []string
DockerPortsHostIP string
SaveSupportArchivePath string
SaveClusterLogsArchivePath string
DeleteStateOnErr bool
KMSEndpoint string
JSONLogsEndpoint string
SiderolinkEnabled bool
}
Options describes Provisioner parameters.
type Provisioner ¶
type Provisioner interface {
Create(context.Context, ClusterRequest, ...Option) (Cluster, error)
Destroy(context.Context, Cluster, ...Option) error
Reflect(ctx context.Context, clusterName, stateDirectory string) (Cluster, error)
GenOptions(NetworkRequest) []generate.Option
GetInClusterKubernetesControlPlaneEndpoint(req NetworkRequest, controlPlanePort int) string
GetExternalKubernetesControlPlaneEndpoint(req NetworkRequest, controlPlanePort int) string
GetTalosAPIEndpoints(NetworkRequest) []string
GetFirstInterface() v1alpha1.IfaceSelector
Close() error
UserDiskName(index int) string
}
Provisioner is an interface each provisioner should implement.
type SiderolinkBind ¶ added in v1.7.0
SiderolinkBind describes a pair of prebinded UUID->Addr for SideroLink agent.
type SiderolinkRequest ¶ added in v1.7.0
type SiderolinkRequest struct {
WireguardEndpoint string
APIEndpoint string
APICertificate []byte
APIKey []byte
SinkEndpoint string
LogEndpoint string
SiderolinkBind []SiderolinkBind
}
SiderolinkRequest describes a request for SideroLink agent.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package access provides methods to access provisioned Talos cluster.
|
Package access provides methods to access provisioned Talos cluster. |
|
internal
|
|
|
cniutils
Package cniutils provides helper functions to parse CNI results.
|
Package cniutils provides helper functions to parse CNI results. |
|
inmemhttp
Package inmemhttp implements temporary HTTP server which is based off memory fs.
|
Package inmemhttp implements temporary HTTP server which is based off memory fs. |
|
docker
Package docker implements Provisioner via docker.
|
Package docker implements Provisioner via docker. |
|
vm
Package vm implements common methods for VM provisioners.
|
Package vm implements common methods for VM provisioners. |
|
vm/internal/ipxe
Package ipxe provides utility to deliver iPXE images and build iPXE scripts.
|
Package ipxe provides utility to deliver iPXE images and build iPXE scripts. |