cluster-api: Index | Files

package bootstrap

import ""


Package Files

interfaces.go kind_provider.go kind_util.go


const (
    // DefaultNodeImage is the default node image to be used for for testing.
    DefaultNodeImage = "kindest/node:v1.19.1"

func LoadImagesToKindCluster Uses

func LoadImagesToKindCluster(ctx context.Context, input LoadImagesToKindClusterInput) error

LoadImagesToKindCluster provides a utility for loading images into a kind cluster.

func NewKindClusterProvider Uses

func NewKindClusterProvider(name string, options ...KindClusterOption) *kindClusterProvider

NewKindClusterProvider returns a ClusterProvider that can create a kind cluster.

type ClusterProvider Uses

type ClusterProvider interface {
    // Create a Kubernetes cluster.
    // Generally to be used in the BeforeSuite function to create a Kubernetes cluster to be shared between tests.

    // GetKubeconfigPath returns the path to the kubeconfig file to be used to access the Kubernetes cluster.
    GetKubeconfigPath() string

    // Dispose will completely clean up the provisioned cluster.
    // This should be implemented as a synchronous function.
    // Generally to be used in the AfterSuite function if a Kubernetes cluster is shared between tests.
    // Should try to clean everything up and report any dangling artifacts that needs manual intervention.

ClusterProvider defines the behavior of a type that is responsible for provisioning and managing a Kubernetes cluster.

func CreateKindBootstrapClusterAndLoadImages Uses

func CreateKindBootstrapClusterAndLoadImages(ctx context.Context, input CreateKindBootstrapClusterAndLoadImagesInput) ClusterProvider

CreateKindBootstrapClusterAndLoadImages returns a new Kubernetes cluster with pre-loaded images.

type CreateKindBootstrapClusterAndLoadImagesInput Uses

type CreateKindBootstrapClusterAndLoadImagesInput struct {
    // Name of the cluster
    Name string

    // RequiresDockerSock defines if the cluster requires the docker sock
    RequiresDockerSock bool

    // Images to be loaded in the cluster (this is kind specific)
    Images []clusterctl.ContainerImage

CreateKindBootstrapClusterAndLoadImagesInput is the input for CreateKindBootstrapClusterAndLoadImages.

type KindClusterOption Uses

type KindClusterOption interface {
    // contains filtered or unexported methods

KindClusterOption is a NewKindClusterProvider option

func WithDockerSockMount Uses

func WithDockerSockMount() KindClusterOption

WithDockerSockMount implements a New Option that instruct the kindClusterProvider to mount /var/run/docker.sock into the new kind cluster.

func WithNodeImage Uses

func WithNodeImage(image string) KindClusterOption

WithNodeImage implements a New Option that instruct the kindClusterProvider to use a specific node image / Kubernetes version

type LoadImagesToKindClusterInput Uses

type LoadImagesToKindClusterInput struct {
    // Name of the cluster
    Name string

    // Images to be loaded in the cluster (this is kind specific)
    Images []clusterctl.ContainerImage

LoadImagesToKindClusterInput is the input for LoadImagesToKindCluster.

Package bootstrap imports 13 packages (graph) and is imported by 1 packages. Updated 2021-01-24. Refresh now. Tools for package owners.