cluster

package
v0.0.0-...-b65a399 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterMap

func ClusterMap() (map[string]*Cluster, error)

func Copy

func Copy(src, dest string) error

Copy copies a file from the host to each node in the cluster

func Delete

func Delete(clusterName string) error

func Kubeconfig

func Kubeconfig(clusterName string, write bool) (string, error)

func Shell

func Shell(clusterName, nodeName string) error

Types

type Cluster

type Cluster struct {
	Name                   string
	Status                 string
	Created                metav1.Time
	Nodes                  []*Node
	DesiredControllerCount int
	DesiredWorkerCount     int
}

func Create

func Create(options ClusterOptions) (*Cluster, error)

func Get

func Get(clusterName string) (*Cluster, error)

func List

func List() ([]*Cluster, error)

func (*Cluster) AddNode

func (c *Cluster) AddNode(node *Node)

func (*Cluster) ControllerNodes

func (cluster *Cluster) ControllerNodes() []*Node

func (*Cluster) GetNode

func (c *Cluster) GetNode(name string) *Node

func (*Cluster) RemoveNode

func (c *Cluster) RemoveNode(node *Node)

func (*Cluster) WorkerNodes

func (cluster *Cluster) WorkerNodes() []*Node

type ClusterOptions

type ClusterOptions struct {
	Name            string
	ControllerCount int
	WorkerCount     int
}

type Node

type Node struct {
	models.VM
	Controller bool
	Worker     bool
	Number     int
}

func (Node) CopyFrom

func (node Node) CopyFrom(remote, local string) error

func (Node) CopyTo

func (node Node) CopyTo(local, remote string) error

func (Node) CopyToMultiplePaths

func (node Node) CopyToMultiplePaths(paths map[string]string) error

func (Node) Exec

func (node Node) Exec(args []string) (string, string, error)

type NodeStatus

type NodeStatus struct {
	Version    string
	ProcessID  int
	Role       string
	Workloads  bool
	SingleNode bool
}

type Role

type Role int
const (
	Controller Role = iota
	Worker
)

Jump to

Keyboard shortcuts

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