Documentation
¶
Overview ¶
Package provision provides abstract definitions for Talos cluster provisioners.
Index ¶
- type CNIConfig
- type Cluster
- type ClusterInfo
- type ClusterRequest
- type NetworkInfo
- type NetworkRequest
- type NodeInfo
- type NodeRequest
- type NodeRequests
- type Option
- func WithBootlader(enabled bool) Option
- func WithDockerPorts(ports []string) Option
- func WithDockerPortsHostIP(hostIP string) Option
- func WithEndpoint(endpoint string) Option
- func WithLogWriter(w io.Writer) Option
- func WithTalosClient(client *client.Client) Option
- func WithTalosConfig(talosConfig *config.Config) Option
- func WithTargetArch(arch string) Option
- type Options
- type Provisioner
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 }
ClusterInfo describes the cluster.
type ClusterRequest ¶
type ClusterRequest struct { Name string Network NetworkRequest Nodes NodeRequests Image string KernelPath string InitramfsPath 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 }
ClusterRequest is the root object describing cluster to be provisioned.
type NetworkInfo ¶
NetworkInfo describes cluster network.
type NetworkRequest ¶
type NetworkRequest struct { Name string CIDR net.IPNet GatewayAddr net.IP MTU int Nameservers []net.IP // CNI-specific parameters. CNI CNIConfig }
NetworkRequest describes cluster network.
type NodeInfo ¶
type NodeInfo struct { ID string 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 int64 PublicIP net.IP PrivateIP net.IP }
NodeInfo describes a node.
type NodeRequest ¶
type NodeRequest struct { Name string IP net.IP Config config.Provider // Share of CPUs, in 1e-9 fractions NanoCPUs int64 // Memory limit in bytes Memory int64 // Disk (volume) size in bytes, if applicable DiskSize int64 // Ports Ports []string }
NodeRequest describes a request for a node.
type NodeRequests ¶
type NodeRequests []NodeRequest
NodeRequests is a list of NodeRequest.
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) MasterNodes ¶
func (reqs NodeRequests) MasterNodes() (nodes []NodeRequest)
MasterNodes returns subset of nodes which are Init/ControlPlane type.
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 ¶ added in v0.6.0
WithBootlader enables or disables bootloader (bootloader is enabled by default).
func WithDockerPorts ¶ added in v0.4.0
WithDockerPorts allows docker provisioner to expose ports on workers.
func WithDockerPortsHostIP ¶ added in v0.6.0
WithDockerPortsHostIP sets host IP for docker provisioner to expose ports on workers.
func WithEndpoint ¶
WithEndpoint specifies endpoint to use when acessing Talos cluster.
func WithTalosClient ¶ added in v0.4.0
WithTalosClient specifies client to use when acessing Talos cluster.
func WithTalosConfig ¶ added in v0.4.0
WithTalosConfig specifies talosconfig to use when acessing Talos cluster.
func WithTargetArch ¶ added in v0.6.0
WithTargetArch specifies target architecture for the cluster.
type Options ¶
type Options struct { LogWriter io.Writer TalosConfig *config.Config TalosClient *client.Client ForceEndpoint string TargetArch string // Enable bootloader by booting from disk image after install. BootloaderEnabled bool // Expose ports to worker machines in docker provisioner DockerPorts []string DockerPortsHostIP string }
Options describes Provisioner parameters.
type Provisioner ¶
type Provisioner interface { Create(context.Context, ClusterRequest, ...Option) (Cluster, error) Destroy(context.Context, Cluster, ...Option) error CrashDump(context.Context, Cluster, io.Writer) Reflect(ctx context.Context, clusterName, stateDirectory string) (Cluster, error) GenOptions(NetworkRequest) []generate.GenOption GetLoadBalancers(NetworkRequest) (internalEndpoint, externalEndpoint string) Close() error }
Provisioner is an interface each provisioner should implement.
Directories
¶
Path | Synopsis |
---|---|
Package access provides methods to access provisioned Talos cluster.
|
Package access provides methods to access provisioned Talos cluster. |
docker
Package docker implements Provisioner via docker.
|
Package docker implements Provisioner via docker. |
firecracker
Package firecracker implements Provisioner via Firecracker VMs.
|
Package firecracker implements Provisioner via Firecracker VMs. |
vm
Package vm implements common methods for VM provisioners.
|
Package vm implements common methods for VM provisioners. |