cluster

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const LocalRegistryHostingConfigMap = `` /* 406-byte string literal not displayed */

Variables

This section is empty.

Functions

func AppendOrPatchContainerd

func AppendOrPatchContainerd(cfg *config.ClusterConfiguration, patchData string) error

func BootstrapKrustlet

func BootstrapKrustlet(cluster, name string, port int, node *Node, registries map[string]string) error

func CreateRegistry

func CreateRegistry(name string, port int) error

func DeleteNodes

func DeleteNodes(n []*Node) error

DeleteNodes is part of the providers.Provider interface

func ExportKubeConfig

func ExportKubeConfig(clusterName string, kubeconfigPath string) error

func GetDefault

func GetDefault(logger log.Logger) cluster.ProviderOption

GetDefault selected the default runtime from the environment override

func GetKubeConfig

func GetKubeConfig(clusterName string) (*clientcmdapi.Config, error)

func GetLocalRegistryHostingConfigMap

func GetLocalRegistryHostingConfigMap(cfg *config.ClusterConfiguration) ([]byte, error)

func GetRegistryMirrors

func GetRegistryMirrors(mirrors map[string]string) ([]byte, error)

func ImageID

func ImageID(containerNameOrID string) (string, error)

ImageID return the Id of the container image

func IsContainerRunning

func IsContainerRunning(name string) bool

func PullImage

func PullImage(image string) error

func SetControlPlaneConfigurationDefaults

func SetControlPlaneConfigurationDefaults(cfg *critconfig.ControlPlaneConfiguration)

func SetWorkerConfigurationDefaults

func SetWorkerConfigurationDefaults(cfg *critconfig.WorkerConfiguration)

Types

type Config

type Config struct {
	ClusterName       string
	ContainerName     string
	Image             string
	Role              string
	ExtraMounts       []*config.Mount
	ExtraPortMappings []*config.PortMapping
}

type ControlPlaneConfig

type ControlPlaneConfig struct {
	ClusterName          string
	ContainerName        string
	Image                string
	Verbose              bool
	ClusterConfiguration *config.ClusterConfiguration
}

type Node

type Node struct {
	kindnodes.Node

	Stdout, Stderr io.Writer
	// contains filtered or unexported fields
}

func CreateControlPlaneNode

func CreateControlPlaneNode(ctx context.Context, cfg *ControlPlaneConfig) (*Node, error)

func CreateNode

func CreateNode(ctx context.Context, cfg *Config) (node *Node, reterr error)

func CreateWorkerNode

func CreateWorkerNode(ctx context.Context, cfg *WorkerConfig) (*Node, error)

func GetControlPlaneNode

func GetControlPlaneNode(clusterName string) (*Node, error)

func ListNodes

func ListNodes(clusterName string) ([]*Node, error)

func NewNode

func NewNode(node kindnodes.Node) *Node

func (*Node) CombinedOutput

func (n *Node) CombinedOutput() []byte

func (*Node) Command

func (n *Node) Command(cmd string, args ...string) kindexec.Cmd

func (*Node) IP

func (n *Node) IP() string

func (*Node) LoadImage

func (n *Node) LoadImage(path string) error

func (*Node) MkdirAll

func (n *Node) MkdirAll(path string, perm os.FileMode) error

func (*Node) ReadFile

func (n *Node) ReadFile(path string) ([]byte, error)

func (*Node) RunCloudInit

func (n *Node) RunCloudInit(cfg *config.ClusterConfiguration) (err error)

func (*Node) SystemdReady

func (n *Node) SystemdReady(ctx context.Context) error

func (*Node) WriteFile

func (n *Node) WriteFile(path string, data []byte, perm os.FileMode) error

type WorkerConfig

type WorkerConfig struct {
	ClusterName          string
	ContainerName        string
	Image                string
	Verbose              bool
	ClusterConfiguration *config.ClusterConfiguration
}

Jump to

Keyboard shortcuts

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