Documentation ¶
Overview ¶
Package cluster implements helpers for creating test clusters using kind as a library. The helpers facilitate some common customizations of clusters, such as creating multiple worker nodes or exposing a node port to facilitate the access to services deployed in the cluster using NodePort services. Other customizations can be achieved by providing a valid kind configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster an active test cluster
func (*Cluster) AllocatePort ¶
AllocatePort reserves a port from the pool of ports exposed by the cluster to ensure it is not been used by other service
func (*Cluster) Kubeconfig ¶
Kubeconfig returns the path to the kubeconfig for the test cluster
func (*Cluster) ReleasePort ¶
ReleasePort makes available a Port previously allocated by AllocatePort
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains the configuration for creating a cluster
func DefaultConfig ¶
DefaultConfig creates a ClusterConfig with default options and default name "test-cluster"
type NodePort ¶
type NodePort struct { // NodePort to access in the cluster NodePort int32 // Port used in the host to access the node port HostPort int32 }
NodePort defines the mapping of a node port to host port
type Options ¶
type Options struct { // cluster configuration to use. Overrides other options (NodePorts, Workers) Config string // List of images to pre-load on each node. // The images must be available locally (e.g. with docker pull <image>) Images []string // maximum time to wait for cluster creation. Wait time.Duration // node ports to expose NodePorts []NodePort // number of worker nodes Workers int // Kubernetes version Version string }
Options defines options for customizing the cluster