kind

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name                       string
	KubeconfigPath             string
	Client                     client.Client
	Scheme                     *runtime.Scheme
	WorkloadClusterKubeconfigs map[string]string
}

Cluster represents a Kubernetes cluster used as a management cluster backed by kind.

func NewCluster

func NewCluster(ctx context.Context, name string, scheme *runtime.Scheme, images ...string) (*Cluster, error)

NewCluster sets up a new kind cluster to be used as the management cluster.

func NewClusterWithConfig

func NewClusterWithConfig(ctx context.Context, name, configFile string, scheme *runtime.Scheme, images ...string) (*Cluster, error)

NewClusterWithConfig creates a kind cluster using a kind-config file.

func (*Cluster) Apply

func (c *Cluster) Apply(ctx context.Context, resources []byte) error

Apply wraps `kubectl apply` and prints the output so we can see what gets applied to the cluster. TODO: Remove this usage of kubectl and replace with a function from apply.go using the controller-runtime client.

func (*Cluster) ClientFromRestConfig

func (c *Cluster) ClientFromRestConfig(restConfig *rest.Config) (client.Client, error)

ClientFromRestConfig returns a controller-runtime client from a RESTConfig.

func (*Cluster) GetClient

func (c *Cluster) GetClient() (client.Client, error)

GetClient returns a controller-runtime client for the management cluster.

func (*Cluster) GetClientSet

func (c *Cluster) GetClientSet() (*kubernetes.Clientset, error)

GetClientSet returns a clientset to the management cluster to be used for object interface expansions such as pod logs.

func (*Cluster) GetName

func (c *Cluster) GetName() string

GetName returns the name of the cluster

func (*Cluster) GetWorkloadClient

func (c *Cluster) GetWorkloadClient(ctx context.Context, namespace, name string) (client.Client, error)

GetWorkloadClient returns a controller-runtime client for the workload cluster. TODO Use remote package once it returns a controller runtime client

func (*Cluster) ImageExists

func (c *Cluster) ImageExists(ctx context.Context, image string) bool

func (*Cluster) LoadImage

func (c *Cluster) LoadImage(ctx context.Context, image string) error

LoadImage will put a local image onto the kind node

func (*Cluster) Teardown

func (c *Cluster) Teardown(_ context.Context)

Teardown deletes all the tmp files and cleans up the kind cluster. This does not return an error so that it can clean as much up as possible regardless of error.

func (*Cluster) Wait

func (c *Cluster) Wait(ctx context.Context, args ...string) error

Wait wraps `kubectl wait`.

Jump to

Keyboard shortcuts

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