Documentation ¶
Overview ¶
Package kind contains functions for deploying and managing Kubernetes in Docker (Kind) clusters for integration testing.
Index ¶
Constants ¶
const (
// DefaultKindDockerNetwork is the Docker network that a kind cluster uses by default.
DefaultKindDockerNetwork = "kind"
)
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 ¶
ClientForCluster provides a *kubernetes.Clientset for a KIND cluster provided the cluster name.
func CreateCluster ¶
CreateCluster creates a new cluster using Kubernetes in Docker (KIND).
func DeleteKindCluster ¶
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 ¶
func (c *ClusterConfigurationWithKongProxy) Deploy(ctx context.Context, timeout time.Time) (Cluster, chan ProxyReadinessEvent, error)
Deploy is a factory method to generate kind.Cluster objects given the configuration, with new names being selected on each deploy.
type ProxyReadinessEvent ¶
ProxyReadinessEvent indicates the result of exposing the Kong proxy service in a Cluster