k3tcd

package
v0.0.0-...-a2b1cdb Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadBalance

func LoadBalance(balance, localbind string) error

LoadBalance lol

Types

type Backends

type Backends struct {
	// contains filtered or unexported fields
}

Backends is a set of servers

func (*Backends) String

func (b *Backends) String() string

type Cluster

type Cluster struct {
	// Nodes is a map of Node indexed by their IP
	Nodes map[string]*Node
	// Wait group for goroutines
	Wg sync.WaitGroup
	// Error channel for goroutines
	ErrCh chan error
	// Temporary path in the host for downloaded files
	Tempdir string
	// Services to download and deploy to the nodes
	Components []map[string]string
	// CACerts holds peer and client CAs
	CACerts map[string]map[string][]byte
}

Cluster represents a K3s cluster

func NewCluster

func NewCluster(cmd *cobra.Command) (*Cluster, error)

NewCluster parses flags and creates initial Node structs

func (*Cluster) CleanUp

func (c *Cluster) CleanUp()

CleanUp removes the temporary directory

func (*Cluster) Deploy

func (c *Cluster) Deploy() error

Deploy deploys the cluster artifacts to the target nodes

type Node

type Node struct {
	// Path for etcd data
	DataDir string
	// Path for the binaries
	BinDir string
	// Path for the certificates
	CfgDir string
	// Parameter in the k3s command to set etcd servers
	DataStore string
	// Parameter in the etcd command to set peer etcd servers
	Endpoints string
	// Files to be created in the nodes indexed by their full path
	Files      map[string]string
	IP         string
	User       string
	Pass       string
	Name       string
	SSHKey     string
	SSHPort    string
	SSHClient  *ssh.Client
	SFTPClient *sftp.Client
}

Node is a cluster member

Jump to

Keyboard shortcuts

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