cluster

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCluster

func CreateCluster(ctx context.Context, runtime runtimes.Runtime, cfg *v1alpha4.SimpleConfig) error

func CreateK3DCluster

func CreateK3DCluster(ctx context.Context, runtime runtimes.Runtime, cfg *v1alpha4.SimpleConfig) error

func SetVolume added in v0.1.3

func SetVolume(volumes []interface{}) []v1alpha4.VolumeWithNodeFilters

Types

type Cluster

type Cluster interface {
	GetClusters(context.Context, runtimes.Runtime, []string) ([]*Config, error)
	StartStopCluster(context.Context, runtimes.Runtime, []string) error
}

type Config

type Config struct {
	Name            string   `json:"name,omitempty" mapstructure:"name"`
	Nodes           []string `json:"nodes,omitempty" mapstructure:"nodes"`
	Network         string   `json:"network,omitempty" mapstructure:"network"`
	Token           string   `json:"cluster_token,omitempty" mapstructure:"cluster_token"`
	ServersCount    int      `json:"servers_count,omitempty" mapstructure:"servers_count"`
	ServersRunning  int      `json:"servers_running,omitempty" mapstructure:"servers_running"`
	AgentsCount     int      `json:"agents_count,omitempty" mapstructure:"agents_count"`
	AgentsRunning   int      `json:"agents_running,omitempty" mapstructure:"agents_running"`
	ImageVolume     string   `json:"image_volume,omitempty" mapstructure:"image_volume"`
	HasLoadBalancer bool     `json:"has_loadbalancer,omitempty" mapstructure:"has_loadbalancer"`
	Action          string   `json:"action,omitempty" mapstructure:"action"`
	All             bool     `json:"all,omitempty" mapstructure:"all"`
}

Config helps storing filtered cluster data of k3d cluster.

func (*Config) GetClusterConfig

func (cfg *Config) GetClusterConfig() *K3D.Cluster

func (*Config) GetClusters

func (cfg *Config) GetClusters(ctx context.Context, runtime runtimes.Runtime, clusterList []string) ([]*Config, error)

func (*Config) StartStopCluster

func (cfg *Config) StartStopCluster(ctx context.Context, runtime runtimes.Runtime, clusters []string) error

Jump to

Keyboard shortcuts

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