cluster

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 41 Imported by: 103

Documentation

Index

Constants

View Source
const (
	// MountErrorUnknown failed with unknown error
	MountErrorUnknown = iota
	// MountErrorConnect failed to connect
	MountErrorConnect
	// MountErrorChmod failed to chmod
	MountErrorChmod
)
View Source
const (
	// Configured means configured
	Configured = "Configured" // ~state.Saved
	// Misconfigured means misconfigured
	Misconfigured = "Misconfigured" // ~state.Error
	// Nonexistent means the resource does not exist
	Nonexistent = "Nonexistent" // ~state.None
	// Irrelevant is used for statuses that aren't meaningful for worker nodes
	Irrelevant = "Irrelevant"
)

Additional legacy states

View Source
const (
	Starting  = 100
	Pausing   = 101
	Unpausing = 102
	Stopping  = 110
	Deleting  = 120

	OK       = 200
	HAppy    = 201
	Warning  = 203
	Degraded = 204

	NotFound = 404
	Stopped  = 405
	Paused   = 418 // I'm a teapot!

	Error               = 500
	InsufficientStorage = 507
	Unknown             = 520
)

New status modes, based roughly on HTTP/SMTP standards

Variables

This section is empty.

Functions

func Bootstrapper added in v1.7.3

func Bootstrapper(api libmachine.API, bootstrapperName string, cc config.ClusterConfig, r command.Runner) (bootstrapper.Bootstrapper, error)

Bootstrapper returns a new bootstrapper for the cluster

func CheckIfPaused added in v1.19.0

func CheckIfPaused(cr cruntime.Manager, namespaces []string) (bool, error)

CheckIfPaused checks if the Kubernetes cluster is paused

func ControlPlaneBootstrapper added in v1.10.0

func ControlPlaneBootstrapper(mAPI libmachine.API, cc *config.ClusterConfig, bootstrapperName string) (bootstrapper.Bootstrapper, error)

ControlPlaneBootstrapper returns a bootstrapper for the first available cluster control-plane node.

func DriverIP added in v1.10.0

func DriverIP(api libmachine.API, machineName string) (net.IP, error)

DriverIP gets the ip address of the current minikube cluster

func HostIP added in v1.10.0

func HostIP(host *host.Host, clusterName string) (net.IP, error)

HostIP gets the ip address to be used for mapping host -> VM and VM -> host

func Mount added in v1.0.0

func Mount(r mountRunner, source string, target string, c *MountConfig, pid int) error

Mount runs the mount command from the 9p client on the VM to the 9p server on the host

func Pause added in v1.7.0

func Pause(cr cruntime.Manager, r command.Runner, namespaces []string) ([]string, error)

Pause pauses a Kubernetes cluster, retrying if necessary

func Unmount added in v1.0.0

func Unmount(r mountRunner, target string) error

Unmount unmounts a path

func Unpause added in v1.7.0

func Unpause(cr cruntime.Manager, r command.Runner, namespaces []string) ([]string, error)

Unpause unpauses a Kubernetes cluster, retrying if necessary

Types

type BaseState added in v1.35.0

type BaseState struct {
	// Name is the name of the object
	Name string

	// StatusCode is an HTTP-like status code for this object
	StatusCode int
	// Name is a human-readable name for the status code
	StatusName string
	// StatusDetail is long human-readable string describing why this particular status code was chosen
	StatusDetail string `json:",omitempty"` // Not yet implemented

	// Step is which workflow step the object is at.
	Step string `json:",omitempty"`
	// StepDetail is a long human-readable string describing the step
	StepDetail string `json:",omitempty"`
}

BaseState holds a component state representation, such as "apiserver" or "kubeconfig"

type MountConfig added in v1.0.0

type MountConfig struct {
	// Type is the filesystem type (Typically 9p)
	Type string
	// UID is the User ID which this path will be mounted as
	UID string
	// GID is the Group ID which this path will be mounted as
	GID string
	// Version is the 9P protocol version. Valid options: 9p2000, 9p200.u, 9p2000.L
	Version string
	// MSize is the number of bytes to use for 9p packet payload
	MSize int
	// Port is the port to connect to on the host
	Port int
	// Extra mount options. See https://www.kernel.org/doc/Documentation/filesystems/9p.txt
	Options map[string]string
}

MountConfig defines the options available to the Mount command

type MountError added in v1.23.0

type MountError struct {
	// ErrorType enum for more info about the error
	ErrorType int
	// UnderlyingError the error being wrapped
	UnderlyingError error
}

MountError wrapper around errors in the `Mount` function

func (*MountError) Error added in v1.23.0

func (m *MountError) Error() string

type NodeState added in v1.35.0

type NodeState struct {
	BaseState
	Components map[string]BaseState `json:",omitempty"`
}

NodeState holds a node state representation

type State added in v1.35.0

type State struct {
	BaseState

	BinaryVersion string
	TimeToStop    string `json:",omitempty"`
	Components    map[string]BaseState
	Nodes         []NodeState
}

State holds a cluster state representation

func GetState added in v1.35.0

func GetState(sts []*Status, profile string, cc *config.ClusterConfig) State

GetState converts Status structs into a State struct

type Status added in v1.35.0

type Status struct {
	Name       string
	Host       string
	Kubelet    string
	APIServer  string
	Kubeconfig string
	Worker     bool
	TimeToStop string `json:",omitempty"`
	DockerEnv  string `json:",omitempty"`
	PodManEnv  string `json:",omitempty"`
}

Status holds string representations of component states

func GetStatus added in v1.35.0

func GetStatus(api libmachine.API, cc *config.ClusterConfig) ([]*Status, error)

GetStatus returns the statuses of each node

func NodeStatus added in v1.35.0

func NodeStatus(api libmachine.API, cc config.ClusterConfig, n config.Node) (*Status, error)

NodeStatus looks up the status of a node

Directories

Path Synopsis
ha

Jump to

Keyboard shortcuts

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