Documentation
¶
Index ¶
- type Cluster
- func (c *Cluster) ApplyManifests(ctx context.Context, manifests []byte) error
- func (c *Cluster) Delete(ctx context.Context) error
- func (c *Cluster) ExportLogs(ctx context.Context, dir string) error
- func (c *Cluster) KubeconfigPath() (string, error)
- func (c *Cluster) LoadImages(ctx context.Context, images ...string) error
- func (c *Cluster) Name() string
- func (c *Cluster) RESTConfig() (*rest.Config, error)
- type Option
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 represents a Kind cluster managed by kindkit.
A Cluster is obtained by calling Create. Use Delete to tear it down.
func Create ¶
Create creates a new Kind cluster. On partial failure, both a non-nil *Cluster and an error may be returned so the caller can still inspect or clean up. ctx is reserved for future use; Kind's API does not support cancellation.
func CreateOrReuse ¶
CreateOrReuse returns an existing cluster if its API server is reachable, otherwise creates a new one. Options only apply on create. Like Create, both a non-nil *Cluster and an error may be returned. ctx is reserved for future use; Kind's API does not support cancellation.
func (*Cluster) ApplyManifests ¶
ApplyManifests applies multi-document Kubernetes YAML to the cluster using server-side apply.
func (*Cluster) Delete ¶
Delete deletes the cluster. It is safe to call on an already-deleted cluster. ctx is reserved for future use; Kind's API does not support cancellation.
func (*Cluster) ExportLogs ¶
ExportLogs exports cluster logs to the given directory for debugging. ctx is reserved for future use; Kind's API does not support cancellation.
func (*Cluster) KubeconfigPath ¶
KubeconfigPath writes the kubeconfig to a temporary file and returns its path. The caller is responsible for removing the file.
func (*Cluster) LoadImages ¶
LoadImages loads images from the local Docker daemon into all cluster nodes. The images must already exist locally.
type Option ¶
type Option func(*options)
Option configures cluster creation.
func WithConfigFile ¶
WithConfigFile loads a Kind cluster configuration from a file path. Mutually exclusive with WithRawConfig.
func WithNodeImage ¶
WithNodeImage sets the node Docker image (e.g. "kindest/node:v1.31.0").
func WithRawConfig ¶
WithRawConfig passes a raw Kind cluster configuration YAML (kind: Cluster, apiVersion: kind.x-k8s.io/v1alpha4) to the provider. Mutually exclusive with WithConfigFile. WithNodeImage and WithWaitForReady layer on top.
func WithWaitForReady ¶
WithWaitForReady sets the timeout for waiting for the cluster to be ready.