kind

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// KindClusterType indicates that the Kubernetes cluster was provisioned by Kind.
	KindClusterType clusters.Type = "kind"

	// 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"

	// DefaultKindDockerNetwork is the Docker network that a kind cluster uses by default.
	DefaultKindDockerNetwork = "kind"
)

Variables

This section is empty.

Functions

func NewFromExisting

func NewFromExisting(name string) (clusters.Cluster, error)

NewFromExisting provides a Cluster object for a given kind cluster by name.

Types

type Builder

type Builder struct {
	Name string
	// contains filtered or unexported fields
}

Builder generates clusters.Cluster objects backed by Kind given provided configuration options.

func NewBuilder

func NewBuilder() *Builder

NewBuilder provides a new *Builder object.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) (clusters.Cluster, error)

Build creates and configures clients for a Kind-based Kubernetes clusters.Cluster.

func (*Builder) WithCalicoCNI added in v0.17.0

func (b *Builder) WithCalicoCNI() *Builder

WithCalicoCNI disables the default CNI for the kind cluster and instead deploys Calico (https://projectcalico.docs.tigera.io/about/about-calico) which includes deep features including NetworkPolicy enforcement.

func (*Builder) WithClusterVersion

func (b *Builder) WithClusterVersion(version semver.Version) *Builder

WithClusterVersion configures the Kubernetes cluster version for the Builder to use when building the Kind cluster.

func (*Builder) WithConfig added in v0.13.0

func (b *Builder) WithConfig(filename string) *Builder

WithConfig sets a filename containing a KIND config See: https://kind.sigs.k8s.io/docs/user/configuration This will override any config set previously.

func (*Builder) WithConfigReader added in v0.31.0

func (b *Builder) WithConfigReader(cfg io.Reader) *Builder

WithConfigReader sets a reader containing a KIND config See: https://kind.sigs.k8s.io/docs/user/configuration This will override any config set previously.

func (*Builder) WithIPv6Only added in v0.40.0

func (b *Builder) WithIPv6Only() *Builder

WithIPv6Only configures KIND to only use IPv6.

func (*Builder) WithName added in v0.1.0

func (b *Builder) WithName(name string) *Builder

WithName indicates a custom name to use for the cluster.

type Cluster added in v0.11.0

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster is a clusters.Cluster implementation backed by Kubernetes In Docker (KIND)

func New

func New(ctx context.Context) (*Cluster, error)

New provides a new clusters.Cluster backed by a Kind based Kubernetes Cluster.

func (*Cluster) Cleanup added in v0.11.0

func (c *Cluster) Cleanup(ctx context.Context) error

func (*Cluster) Client added in v0.11.0

func (c *Cluster) Client() *kubernetes.Clientset

func (*Cluster) Config added in v0.11.0

func (c *Cluster) Config() *rest.Config

func (*Cluster) DeleteAddon added in v0.11.0

func (c *Cluster) DeleteAddon(ctx context.Context, addon clusters.Addon) error

func (*Cluster) DeployAddon added in v0.11.0

func (c *Cluster) DeployAddon(ctx context.Context, addon clusters.Addon) error

func (*Cluster) DumpDiagnostics added in v0.24.0

func (c *Cluster) DumpDiagnostics(ctx context.Context, meta string) (string, error)

DumpDiagnostics produces diagnostics data for the cluster at a given time. It uses the provided meta string to write to meta.txt file which will allow for diagnostics identification. It returns the path to directory containing all the diagnostic files and an error.

func (*Cluster) GetAddon added in v0.11.0

func (c *Cluster) GetAddon(name clusters.AddonName) (clusters.Addon, error)

func (*Cluster) IPFamily added in v0.40.0

func (c *Cluster) IPFamily() clusters.IPFamily

func (*Cluster) ListAddons added in v0.11.0

func (c *Cluster) ListAddons() []clusters.Addon

func (*Cluster) Name added in v0.11.0

func (c *Cluster) Name() string

func (*Cluster) Type added in v0.11.0

func (c *Cluster) Type() clusters.Type

func (*Cluster) Version added in v0.11.0

func (c *Cluster) Version() (semver.Version, error)

Jump to

Keyboard shortcuts

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