Documentation
¶
Index ¶
- Variables
- func GetDockerV4Network(ctx context.Context) (net.IPNet, error)
- func NextAvailableLBNetwork(ctx context.Context, c client.Client) (net.IPNet, error)
- func SubnetFromCluster(c *clustersv1alpha1.Cluster) (*net.IPNet, error)
- type ConfigFrom
- type Container
- type IPAM
- type IPAMConfig
- type Network
- type Provider
Constants ¶
This section is empty.
Variables ¶
var ( // AnnotationAssignedSubnet is the annotation used to store the assigned subnet for a cluster AnnotationAssignedSubnet = clustersv1alpha1.GroupVersion.Group + "/assigned-subnet" )
Functions ¶
func GetDockerV4Network ¶
GetDockerV4Network retrieves the IPv4 network configuration of the Docker network named "kind".
func NextAvailableLBNetwork ¶
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 ¶
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.
KubeConfig(name string) (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.