Documentation ¶
Overview ¶
Package cluster implements kind kubernetes-in-docker cluster management
Index ¶
- Constants
- Variables
- type CreateOption
- func CreateWithConfigFile(path string) CreateOption
- func CreateWithDisplaySalutation(displaySalutation bool) CreateOption
- func CreateWithDisplayUsage(displayUsage bool) CreateOption
- func CreateWithKubeconfigPath(explicitPath string) CreateOption
- func CreateWithNodeImage(nodeImage string) CreateOption
- func CreateWithRawConfig(raw []byte) CreateOption
- func CreateWithRetain(retain bool) CreateOption
- func CreateWithStopBeforeSettingUpKubernetes(stopBeforeSettingUpKubernetes bool) CreateOption
- func CreateWithV1Alpha4Config(config *v1alpha4.Cluster) CreateOption
- func CreateWithWaitForReady(waitTime time.Duration) CreateOption
- type Provider
- func (p *Provider) CollectLogs(name, dir string) error
- func (p *Provider) Create(name string, options ...CreateOption) error
- func (p *Provider) Delete(name, explicitKubeconfigPath string) error
- func (p *Provider) ExportKubeConfig(name string, explicitPath string, internal bool) error
- func (p *Provider) KubeConfig(name string, internal bool) (string, error)
- func (p *Provider) List() ([]string, error)
- func (p *Provider) ListInternalNodes(name string) ([]nodes.Node, error)
- func (p *Provider) ListNodes(name string) ([]nodes.Node, error)
- type ProviderOption
Constants ¶
const DefaultName = constants.DefaultClusterName
DefaultName is the default cluster name
Variables ¶
var NoNodeProviderDetectedError = errors.NewWithoutStack("failed to detect any supported node provider")
NoNodeProviderDetectedError indicates that we could not autolocate an available NodeProvider backend on the host
Functions ¶
This section is empty.
Types ¶
type CreateOption ¶ added in v0.6.0
type CreateOption interface {
// contains filtered or unexported methods
}
CreateOption is a Provider.Create option
func CreateWithConfigFile ¶ added in v0.6.0
func CreateWithConfigFile(path string) CreateOption
CreateWithConfigFile configures the config file path to use
func CreateWithDisplaySalutation ¶ added in v0.6.0
func CreateWithDisplaySalutation(displaySalutation bool) CreateOption
CreateWithDisplaySalutation enables display a salutation at the end of create cluster if displaySalutation is true
func CreateWithDisplayUsage ¶ added in v0.6.0
func CreateWithDisplayUsage(displayUsage bool) CreateOption
CreateWithDisplayUsage enables displaying usage if displayUsage is true
func CreateWithKubeconfigPath ¶ added in v0.6.0
func CreateWithKubeconfigPath(explicitPath string) CreateOption
CreateWithKubeconfigPath sets the explicit --kubeconfig path
func CreateWithNodeImage ¶ added in v0.6.0
func CreateWithNodeImage(nodeImage string) CreateOption
CreateWithNodeImage overrides the image on all nodes in config as an easy way to change the Kubernetes version
func CreateWithRawConfig ¶ added in v0.6.0
func CreateWithRawConfig(raw []byte) CreateOption
CreateWithRawConfig configures the config to use from raw (yaml) bytes
func CreateWithRetain ¶ added in v0.6.0
func CreateWithRetain(retain bool) CreateOption
CreateWithRetain disables deletion of nodes and any other cleanup that would normally occur after a failure to create This is mainly used for debugging purposes
func CreateWithStopBeforeSettingUpKubernetes ¶ added in v0.6.0
func CreateWithStopBeforeSettingUpKubernetes(stopBeforeSettingUpKubernetes bool) CreateOption
CreateWithStopBeforeSettingUpKubernetes enables skipping setting up kubernetes (kubeadm init etc.) after creating node containers This generally shouldn't be used and is only lightly supported, but allows provisioning node containers for experimentation
func CreateWithV1Alpha4Config ¶ added in v0.7.0
func CreateWithV1Alpha4Config(config *v1alpha4.Cluster) CreateOption
CreateWithV1Alpha4Config configures the cluster with a v1alpha4 config
func CreateWithWaitForReady ¶ added in v0.6.0
func CreateWithWaitForReady(waitTime time.Duration) CreateOption
CreateWithWaitForReady configures a maximum wait time for the control plane node(s) to be ready. By default no waiting is performed
type Provider ¶ added in v0.6.0
type Provider struct {
// contains filtered or unexported fields
}
Provider is used to perform cluster operations
func NewProvider ¶ added in v0.6.0
func NewProvider(options ...ProviderOption) *Provider
NewProvider returns a new provider based on the supplied options
func (*Provider) CollectLogs ¶ added in v0.6.0
CollectLogs will populate dir with cluster logs and other debug files
func (*Provider) Create ¶ added in v0.6.0
func (p *Provider) Create(name string, options ...CreateOption) error
Create provisions and starts a kubernetes-in-docker cluster
func (*Provider) ExportKubeConfig ¶ added in v0.6.0
ExportKubeConfig exports the KUBECONFIG for the cluster, merging it into the selected file, following the rules from https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#config where explicitPath is the --kubeconfig value.
func (*Provider) KubeConfig ¶ added in v0.6.0
KubeConfig returns the KUBECONFIG for the cluster If internal is true, this will contain the internal IP etc. If internal is false, this will contain the host IP etc.
func (*Provider) ListInternalNodes ¶ added in v0.6.0
ListInternalNodes returns the list of container IDs for the "nodes" in the cluster that are not external
type ProviderOption ¶ added in v0.6.0
type ProviderOption interface {
// contains filtered or unexported methods
}
ProviderOption is an option for configuring a provider
func DetectNodeProvider ¶ added in v0.11.0
func DetectNodeProvider() (ProviderOption, error)
DetectNodeProvider allows callers to autodetect the node provider *without* fallback to the default.
Pass the returned ProviderOption to NewProvider to pass the auto-detect Docker or Podman option explicitly (in the future there will be more options)
NOTE: The kind *cli* also checks `KIND_EXPERIMENTAL_PROVIDER` for "podman" or "docker" currently and does not auto-detect / respects this if set.
This will be replaced with some other mechanism in the future (likely when podman support is GA), in the meantime though your tool may wish to match this.
In the future when this is not considered experimental, that logic will be in a public API as well.
func ProviderWithDocker ¶ added in v0.8.0
func ProviderWithDocker() ProviderOption
ProviderWithDocker configures the provider to use docker runtime
func ProviderWithLogger ¶ added in v0.6.0
func ProviderWithLogger(logger log.Logger) ProviderOption
ProviderWithLogger configures the provider to use Logger logger
func ProviderWithPodman ¶ added in v0.8.0
func ProviderWithPodman() ProviderOption
ProviderWithPodman configures the provider to use podman runtime
Directories ¶
Path | Synopsis |
---|---|
Package constants contains well known constants for kind clusters
|
Package constants contains well known constants for kind clusters |
internal
|
|
create/actions/config
Package config implements the kubeadm config action
|
Package config implements the kubeadm config action |
create/actions/installcni
Package installcni implements the install CNI action
|
Package installcni implements the install CNI action |
create/actions/installstorage
Package installstorage implements the an action to install a default storageclass
|
Package installstorage implements the an action to install a default storageclass |
create/actions/kubeadminit
Package kubeadminit implements the kubeadm init action
|
Package kubeadminit implements the kubeadm init action |
create/actions/kubeadmjoin
Package kubeadmjoin implements the kubeadm join action
|
Package kubeadmjoin implements the kubeadm join action |
create/actions/loadbalancer
Package loadbalancer implements the load balancer configuration action
|
Package loadbalancer implements the load balancer configuration action |
create/actions/waitforready
Package waitforready implements the wait for ready action
|
Package waitforready implements the wait for ready action |
kubeadm
Package kubeadm contains kubeadm related constants and configuration
|
Package kubeadm contains kubeadm related constants and configuration |
kubeconfig
Package kubeconfig provides utilities kind uses internally to manage kind cluster kubeconfigs
|
Package kubeconfig provides utilities kind uses internally to manage kind cluster kubeconfigs |
loadbalancer
Package loadbalancer contains external loadbalancer related constants and configuration
|
Package loadbalancer contains external loadbalancer related constants and configuration |
logs
Package logs contains tooling for obtaining cluster logs
|
Package logs contains tooling for obtaining cluster logs |
providers/common
Package common contains common code for implementing providers
|
Package common contains common code for implementing providers |
Package nodes provides a kind specific definition of a cluster node
|
Package nodes provides a kind specific definition of a cluster node |
Package nodeutils contains functionality for Kubernetes-in-Docker nodes It mostly exists to break up functionality from sigs.k8s.io/kind/pkg/cluster
|
Package nodeutils contains functionality for Kubernetes-in-Docker nodes It mostly exists to break up functionality from sigs.k8s.io/kind/pkg/cluster |