kind

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// AnnotationAssignedSubnet is the annotation used to store the assigned subnet for a cluster
	AnnotationAssignedSubnet = clustersv1alpha1.GroupVersion.Group + "/assigned-subnet"
)

Functions

func GetDockerV4Network

func GetDockerV4Network(ctx context.Context) (net.IPNet, error)

GetDockerV4Network retrieves the IPv4 network configuration of the Docker network named "kind".

func NextAvailableLBNetwork

func NextAvailableLBNetwork(ctx context.Context, c client.Client) (net.IPNet, error)

NextAvailableLBNetwork finds the next available subnet for MetalLB in the Docker network.

func SubnetFromCluster

func SubnetFromCluster(c *clustersv1alpha1.Cluster) (*net.IPNet, error)

SubnetFromCluster extracts the assigned subnet from the cluster annotations.

Types

type ConfigFrom

type ConfigFrom struct {
	Network string `json:"Network"`
}

ConfigFrom represents the source network for configuration data.

type Container

type Container struct {
	Name        string `json:"Name"`
	EndpointID  string `json:"EndpointID"`
	MacAddress  string `json:"MacAddress"`
	IPv4Address string `json:"IPv4Address"`
	IPv6Address string `json:"IPv6Address"`
}

Container represents a container within the network.

type IPAM

type IPAM struct {
	Driver  string            `json:"Driver"`
	Options map[string]string `json:"Options"`
	Config  []IPAMConfig      `json:"Config"`
}

IPAM represents IP address management configuration.

type IPAMConfig

type IPAMConfig struct {
	Subnet  string `json:"Subnet"`
	Gateway string `json:"Gateway"`
}

IPAMConfig represents individual configurations within the IPAMConfig array.

type Network

type Network struct {
	Name       string               `json:"Name"`
	ID         string               `json:"ID"`
	Created    string               `json:"Created"`
	Scope      string               `json:"Scope"`
	Driver     string               `json:"Driver"`
	EnableIPv6 bool                 `json:"EnableIPv6"`
	IPAM       IPAM                 `json:"IPAM"`
	Internal   bool                 `json:"Internal"`
	Attachable bool                 `json:"Attachable"`
	Ingress    bool                 `json:"Ingress"`
	ConfigFrom ConfigFrom           `json:"ConfigFrom"`
	ConfigOnly bool                 `json:"ConfigOnly"`
	Containers map[string]Container `json:"Containers"`
	Options    map[string]string    `json:"Options"`
	Labels     map[string]string    `json:"Labels"`
}

Network represents the network configuration struct.

type Provider

type Provider interface {
	// CreateCluster creates a new Kubernetes cluster with the given name.
	CreateCluster(name string) error

	// DeleteCluster deletes the Kubernetes cluster with the given name.
	DeleteCluster(name string) error

	// ClusterExists checks if a Kubernetes cluster with the given name exists.
	ClusterExists(name string) (bool, error)

	// KubeConfig retrieves the kubeconfig for the specified cluster name. The bool localhosts indicates whether the function returns a kubeconfig with the local host IP or the container IP.
	KubeConfig(name string, localhost bool) (string, error)
}

Provider defines the interface for managing Kubernetes clusters using kind. It provides methods to create, delete, check existence of clusters, and retrieve kubeconfig.

func NewKindProvider added in v0.0.3

func NewKindProvider() Provider

NewKindProvider returns a new instance of the kind provider for managing Kubernetes clusters. It uses the default Docker-based kind provider configuration.

Jump to

Keyboard shortcuts

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