cluster

package
v0.0.0-...-60784e1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLoopbackService

func CreateLoopbackService(k8sclient *kubernetes.Clientset, domain string) error

func GetConfig

func GetConfig(kubeconfigPath string, context string) (*rest.Config, error)

TODO: Use context and kubeconfig to build a client config.

func IsClusterAvailableCheck

func IsClusterAvailableCheck(clusterConfig *ClusterConfig) error

func KubeconfigPath

func KubeconfigPath(override string, fallback string) string

Types

type ClusterConfig

type ClusterConfig struct {
	Kubeconfig string
	Context    string
}

func NewClusterConfig

func NewClusterConfig(kubeconfig string, context string) *ClusterConfig

func NewClusterConfigIfAvailable

func NewClusterConfigIfAvailable(kubeconfig string, context string) (*ClusterConfig, error)

func (*ClusterConfig) GetClient

func (o *ClusterConfig) GetClient() (*kubernetes.Clientset, error)

func (*ClusterConfig) GetConfig

func (o *ClusterConfig) GetConfig() (*rest.Config, error)

func (*ClusterConfig) GetDiscoveryClient

func (o *ClusterConfig) GetDiscoveryClient() (*discovery.DiscoveryClient, error)

func (*ClusterConfig) GetDynamicClient

func (o *ClusterConfig) GetDynamicClient() (dynamic.Interface, error)

type KindApiServer

type KindApiServer struct {
	Address string
	Port    int
}

type KindBootstrapInput

type KindBootstrapInput struct {
	ListenAddress string
	ApiServer     KindApiServer
	Networking    KindNetworking
	VolumeMounts  []KindVolumeMount
	// Nodes, when non-empty, fully describes the cluster's nodes (the
	// template renders a node per entry). Empty keeps the default single
	// control-plane node.
	Nodes []KindNode
}

KindBootstrapInput is the focused payload the kind-cluster template reads from. Decouples cluster-bootstrap rendering from any specific CLI config kind: 'local cluster create' builds one from EducatesLocalConfig; future scenario kinds (GKE/EKS — though they would not use kind) or test fixtures build it directly.

type KindClusterConfig

type KindClusterConfig struct {
	Config ClusterConfig
	// contains filtered or unexported fields
}

func NewKindClusterConfig

func NewKindClusterConfig(kubeconfig string) *KindClusterConfig

func (*KindClusterConfig) ClusterExists

func (o *KindClusterConfig) ClusterExists() (bool, error)

ClusterExists reports whether the 'educates' kind cluster currently exists. err is set only when the underlying list call failed; the existence outcome itself is not an error — callers decide whether "exists" or "does not exist" is acceptable for the operation they're performing (CreateCluster wants !exists; Delete/Start/Stop/Status want exists).

func (*KindClusterConfig) ClusterStatus

func (o *KindClusterConfig) ClusterStatus() error

func (*KindClusterConfig) CreateCluster

func (o *KindClusterConfig) CreateCluster(input *KindBootstrapInput, image string, onPhase func(string), verbose bool) error

CreateCluster boots the 'educates' kind cluster. By default kind's own status spinner and end-of-create salutation/usage footer are suppressed: each kind phase is forwarded to onPhase (so the caller can render it on one line), and the footer chatter is turned off. When verbose is true kind's full logger is used instead (spinner + detail on stderr) and onPhase is ignored.

func (*KindClusterConfig) DeleteCluster

func (o *KindClusterConfig) DeleteCluster() error

func (*KindClusterConfig) StartCluster

func (o *KindClusterConfig) StartCluster() error

func (*KindClusterConfig) StopCluster

func (o *KindClusterConfig) StopCluster() error

type KindNetworking

type KindNetworking struct {
	ServiceSubnet string
	PodSubnet     string
}

type KindNode

type KindNode struct {
	Role   string
	Labels map[string]string
	Taints []KindNodeTaint
}

KindNode is one node in a multi-node kind cluster. Labels become Kubernetes node labels; Taints are registered on worker nodes at join time. The control-plane node additionally carries the ingress-ready label and the host port mappings / volume mounts.

func (KindNode) LabelsCSV

func (n KindNode) LabelsCSV() string

LabelsCSV renders the node's labels as a comma-separated key=value list in sorted key order, or the empty string when there are none. Used by the kind config template's kubelet node-labels argument.

func (KindNode) TaintsCSV

func (n KindNode) TaintsCSV() string

TaintsCSV renders the node's taints as a comma-separated key=value:effect (or key:effect when no value) list, or the empty string when there are none. Used by the kubelet register-with-taints argument.

type KindNodeTaint

type KindNodeTaint struct {
	Key    string
	Value  string
	Effect string
}

type KindVolumeMount

type KindVolumeMount struct {
	HostPath      string
	ContainerPath string
	// HasReadOnly + ReadOnly map to kind's extraMounts[].readOnly.
	// The pair models a nullable bool without requiring text/template
	// pointer dereference: HasReadOnly=false leaves the field unset
	// (kind defaults to read-write); HasReadOnly=true emits the
	// explicit ReadOnly value into the template.
	HasReadOnly bool
	ReadOnly    bool
}

Jump to

Keyboard shortcuts

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