kind

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyClusterInfo = ClusterInfo{}

Functions

This section is empty.

Types

type Client

type Client interface {
	// CreateCluster creates a kind cluster and adds the context to the kubeconfig
	CreateCluster(request CreateKindClusterRequest) (ClusterInfo, error)
	// DeleteCluster deletes a kind cluster. This will stop the kind cluster and remove the context from
	// the kubeconfig
	DeleteCluster(request DeleteKindClusterRequest) error
	// LoadImageArchive loads a docker image into a kind cluster from an archive file
	LoadImageArchive(req LoadImageArchiveRequest) (LoadedImageResult, error)
	// LoadImage loads a docker image into a kind cluster
	LoadImage(req LoadImageRequest) (LoadedImageResult, error)
}

Client a kind client for managing kind clusters.

func NewLocalClient

func NewLocalClient(logger log.Logger) Client

type ClusterInfo

type ClusterInfo struct {
	KubeConfigBase64     string
	ContextName          string
	ClientCertificate    string
	ClientKey            string
	ClusterCACertificate string
	Endpoint             string
}

func GetClusterInfo

func GetClusterInfo(name string) (ClusterInfo, error)

GetClusterInfo gets the cluster info for a local kind cluster.

type CreateKindClusterRequest

type CreateKindClusterRequest struct {
	Name           string
	KubeConfigPath string
	WaitTimeout    string
}

type DeleteKindClusterRequest

type DeleteKindClusterRequest struct {
	Name           string
	KubeConfigPath string
}

type LoadImageArchiveRequest

type LoadImageArchiveRequest struct {
	ClusterName  string
	ImageArchive string
}

type LoadImageRequest

type LoadImageRequest struct {
	ClusterName string
	ImageName   string
	Tag         string
}

func (LoadImageRequest) GetImageRef

func (l LoadImageRequest) GetImageRef() string

GetImageRef gets the image ref for the request, i.e. name:tag.

type LoadedImageResult

type LoadedImageResult struct {
	// Images the images that were loaded. Each image is loaded on each node
	Images []docker.ImageInfo
	// Nodes kind cluster control plane nodes where the images were loaded
	Nodes []string
}

LoadedImageResult info about what cluster nodes an image was loaded on.

func (*LoadedImageResult) ID

func (l *LoadedImageResult) ID() string

ID generates an id, by hashing the loaded image IDs, falls back to a random id if hashing fails.

Jump to

Keyboard shortcuts

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