Documentation
¶
Overview ¶
Package clustermanager manages clusters, nodes, drivers and versions.
Index ¶
- func DeleteCluster(clustername string, force bool) error
- func ForEachCluster(f func(*Cluster) bool)
- func ForEachDriver(f func(*Driver) bool)
- func IsValidName(name string) bool
- func IsValidPort(portnumber int) bool
- func NewEmptyCluster(name string, k8sversion string, drivername string) error
- func ValidateClusterName(name string) error
- type Cluster
- type Driver
- func (d *Driver) Description() string
- func (d *Driver) ForEachVersion(f func(*Version) bool) error
- func (d *Driver) GetVersion(version string) (*Version, error)
- func (d *Driver) Name() string
- func (d *Driver) RequiresPortForwarding() bool
- func (d *Driver) Status() string
- func (d *Driver) UpdateVersions() error
- type Node
- func (n *Node) CheckHostport(hostport int) error
- func (n *Node) Cluster() *Cluster
- func (n *Node) ForceStop() error
- func (n *Node) ForwardPort(hostport int, nodeport int) error
- func (n *Node) ForwardSSHPort(hostport int) error
- func (n *Node) Start() error
- func (n *Node) Status() string
- func (n *Node) Stop() error
- func (n *Node) UnforwardPort(nodeport int) error
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCluster ¶
DeleteCluster deletes a cluster. Currently, the cluster must be empty.
func ForEachCluster ¶
ForEachCluster iterates over clusters
func IsValidName ¶
IsValidName checks for the validity of a name. Valid names are up to 10 characters long, must start with a lowercase letter, and may contain lowercase letters and digits only.
func IsValidPort ¶
IsValidPort checks for the validity of a port number.
func NewEmptyCluster ¶
NewEmptyCluster creates a new, empty cluster
func ValidateClusterName ¶
ValidateClusterName checks for the validity of a cluster name. It uses IsValidname to check name validity, and also checks if a cluster name already exists.
Types ¶
type Cluster ¶
type Cluster struct { Name string DriverName string K8sVersion string NetworkName string Nodes map[string]*Node Type string // contains filtered or unexported fields }
Cluster is a cluster
func GetCluster ¶
GetCluster gets a named cluster, or nil if not present
func (*Cluster) CheckHostport ¶
CheckHostport checks if a host port is occupied in the current cluster.
func (*Cluster) DeleteNode ¶
DeleteNode deletes a node completely. By default, a node is not deleted if it is running. The force parameter causes the node to be stopped and deleted. In some rare cases for some drivers, manual cleanup may be needed after a forced delete.
func (*Cluster) NewUninitializedNode ¶
NewUninitializedNode adds a node, but does not join it to a kubernetes cluster
func (*Cluster) ValidateNodeName ¶
ValidateNodeName checks for the validity of a node name. It uses IsValidname to check name validity, and also checks if a node name already exists in the cluster.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is a kutti driver
func (*Driver) Description ¶
Description is a one-line decription of the driver
func (*Driver) ForEachVersion ¶
ForEachVersion iterates over available versions for this driver
func (*Driver) GetVersion ¶
GetVersion gets the specified version, or nil
func (*Driver) RequiresPortForwarding ¶
RequiresPortForwarding specifies if the driver's networks use NAT, and therefore require host ports to be forwarded
func (*Driver) UpdateVersions ¶
UpdateVersions fetches the latest list of available versions for this driver
type Node ¶
type Node struct { ClusterName string Name string Type string Ports map[int]int // contains filtered or unexported fields }
Node is a node
func (*Node) CheckHostport ¶
CheckHostport checks if a host port is occupied in the current cluster.
func (*Node) ForwardPort ¶
ForwardPort forwards a port of the node to the specified host port
func (*Node) ForwardSSHPort ¶
ForwardSSHPort forwards the node's SSH port
func (*Node) UnforwardPort ¶
UnforwardPort removes any mapping of the specified node port
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version is a Kubernetes version that may be available to create a cluster
func (*Version) K8sversion ¶
K8sversion returns the Kubernetes version string
func (*Version) PurgeLocal ¶
PurgeLocal removes the local cached copy of a version image