kind

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package kind contains functions for deploying and managing Kubernetes in Docker (Kind) clusters for integration testing.

Index

Constants

View Source
const (
	// DefaultKindDockerNetwork is the Docker network that a kind cluster uses by default.
	DefaultKindDockerNetwork = "kind"
)
View Source
const (
	// EnvKeepCluster is the environment variable that can be set to "true" in order
	// to circumvent teardown during cleanup of clusters in order to allow a user to inspect them instead.
	EnvKeepCluster = "KIND_KEEP_CLUSTER"
)

Variables

This section is empty.

Functions

func ClientForCluster

func ClientForCluster(name string) (*rest.Config, *kubernetes.Clientset, error)

ClientForCluster provides a *kubernetes.Clientset for a KIND cluster provided the cluster name.

func CreateCluster

func CreateCluster(name string) error

CreateCluster creates a new cluster using Kubernetes in Docker (KIND).

func DeleteKindCluster

func DeleteKindCluster(name string) error

DeleteKindCluster deletes an existing KIND cluster.

Types

type Cluster

type Cluster interface {
	// Name indicates the kind cluster name of the running cluster.
	Name() string

	// Client is the configured *kubernetes.Clientset which can be used to access the Cluster's API
	Client() *kubernetes.Clientset

	// Config provides the *rest.Config for the cluster which is convenient for initiating custom kubernetes.Clientsets.
	Config() *rest.Config

	// Cleanup obliterates the cluster and all of its resources, leaving no garbage behind, unless `KIND_KEEP_CLUSTER` is set.
	Cleanup() error
}

Cluster objects represent a running Kind cluster on the local container runtime.

type ClusterConfigurationWithKongProxy

type ClusterConfigurationWithKongProxy struct {
	// DockerNetwork indicates the name of the Docker network to use for LoadBalancer IPs
	DockerNetwork string

	// EnableMetalLB instructions the deployment of MetalLB to support provisioning LoadBalancer Services in the cluster.
	EnableMetalLB bool
}

ClusterConfigurationWithKongProxy is an object representing a Kind cluster's configuration and can effectively be used as a factory for kind cluster deployments. Clusters created from these configurations are opinionated, and will always automatically pre-deploy a Kong proxy service.

func (*ClusterConfigurationWithKongProxy) Deploy

Deploy is a factory method to generate kind.Cluster objects given the configuration, with new names being selected on each deploy.

type ProxyReadinessEvent

type ProxyReadinessEvent struct {
	URL *url.URL
	Err error
}

ProxyReadinessEvent indicates the result of exposing the Kong proxy service in a Cluster

Jump to

Keyboard shortcuts

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