kubeadm

package
v1.4.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 41 Imported by: 16

Documentation

Index

Constants

View Source
const (
	KubeadmCmdParam    = iota
	KubeadmConfigParam = iota
)

enum to differentiate kubeadm command line parameters from kubeadm config file parameters (see the KubeadmExtraArgsWhitelist variable below for more info)

View Source
const (
	Kubelet           = "kubelet"
	Kubeadm           = "kubeadm"
	Apiserver         = "apiserver"
	Scheduler         = "scheduler"
	ControllerManager = "controller-manager"
)

These are the components that can be configured through the "extra-config"

Variables

View Source
var KubeadmExtraArgsWhitelist = map[int][]string{
	KubeadmCmdParam: {
		"ignore-preflight-errors",
		"dry-run",
		"kubeconfig",
		"kubeconfig-dir",
		"node-name",
		"cri-socket",
		"experimental-upload-certs",
		"certificate-key",
		"rootfs",
	},
	KubeadmConfigParam: {
		"pod-network-cidr",
	},
}

KubeadmExtraArgsWhitelist is a whitelist of supported kubeadm params that can be supplied to kubeadm through minikube's ExtraArgs parameter. The list is split into two parts - params that can be supplied as flags on the command line and params that have to be inserted into the kubeadm config file. This is because of a kubeadm constraint which allows only certain params to be provided from the command line when the --config parameter is specified

View Source
var PodsByLayer = []pod{
	{"proxy", "k8s-app", "kube-proxy"},
	{"etcd", "component", "etcd"},
	{"scheduler", "component", "kube-scheduler"},
	{"controller", "component", "kube-controller-manager"},
	{"dns", "k8s-app", "kube-dns"},
}

PodsByLayer are queries we run when health checking, sorted roughly by dependency layer

View Source
var SkipAdditionalPreflights = map[string][]string{}

SkipAdditionalPreflights are additional preflights we skip depending on the runtime in use.

Functions

func DefaultOptionsForComponentAndVersion added in v0.22.3

func DefaultOptionsForComponentAndVersion(component string, version semver.Version) (map[string]string, error)

DefaultOptionsForComponentAndVersion returns the default option for a component and version

func ExtraConfigForComponent added in v0.22.3

func ExtraConfigForComponent(component string, opts config.ExtraOptionSlice, version semver.Version) (map[string]string, error)

ExtraConfigForComponent generates a map of flagname-value pairs for a k8s component.

func NewKubeletConfig added in v0.22.3

func NewKubeletConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, error)

NewKubeletConfig generates a new systemd unit containing a configured kubelet based on the options present in the KubernetesConfig.

func NewKubeletService added in v1.4.0

func NewKubeletService(cfg config.KubernetesConfig) ([]byte, error)

NewKubeletService returns a generated systemd unit file for the kubelet

func ParseFeatureArgs added in v0.28.1

func ParseFeatureArgs(featureGates string) (map[string]bool, string, error)

ParseFeatureArgs parses feature args into extra args

func Supports added in v0.28.1

func Supports(featureName string) bool

Supports indicates whether a feature name is supported on the feature gates for kubeadm

func VersionIsBetween added in v0.22.3

func VersionIsBetween(version, gte, lte semver.Version) bool

VersionIsBetween checks if a version is between (or including) two given versions

Types

type Bootstrapper added in v1.0.0

type Bootstrapper struct {
	// contains filtered or unexported fields
}

Bootstrapper is a bootstrapper using kubeadm

func NewKubeadmBootstrapper

func NewKubeadmBootstrapper(api libmachine.API) (*Bootstrapper, error)

NewKubeadmBootstrapper creates a new kubeadm.Bootstrapper

func (*Bootstrapper) DeleteCluster added in v1.0.0

func (k *Bootstrapper) DeleteCluster(k8s config.KubernetesConfig) error

DeleteCluster removes the components that were started earlier

func (*Bootstrapper) GetAPIServerStatus added in v1.0.0

func (k *Bootstrapper) GetAPIServerStatus(ip net.IP, apiserverPort int) (string, error)

GetAPIServerStatus returns the api-server status

func (*Bootstrapper) GetKubeletStatus added in v1.0.0

func (k *Bootstrapper) GetKubeletStatus() (string, error)

GetKubeletStatus returns the kubelet status

func (*Bootstrapper) LogCommands added in v1.0.0

func (k *Bootstrapper) LogCommands(o bootstrapper.LogOptions) map[string]string

LogCommands returns a map of log type to a command which will display that log.

func (*Bootstrapper) PullImages added in v1.0.0

func (k *Bootstrapper) PullImages(k8s config.KubernetesConfig) error

PullImages downloads images that will be used by RestartCluster

func (*Bootstrapper) RestartCluster added in v1.0.0

func (k *Bootstrapper) RestartCluster(k8s config.KubernetesConfig) error

RestartCluster restarts the Kubernetes cluster configured by kubeadm

func (*Bootstrapper) SetupCerts added in v1.0.0

func (k *Bootstrapper) SetupCerts(k8s config.KubernetesConfig) error

SetupCerts sets up certificates within the cluster.

func (*Bootstrapper) StartCluster added in v1.0.0

func (k *Bootstrapper) StartCluster(k8s config.KubernetesConfig) error

StartCluster starts the cluster

func (*Bootstrapper) UpdateCluster added in v1.0.0

func (k *Bootstrapper) UpdateCluster(cfg config.KubernetesConfig) error

UpdateCluster updates the cluster

func (*Bootstrapper) WaitCluster added in v1.1.0

func (k *Bootstrapper) WaitCluster(k8s config.KubernetesConfig, timeout time.Duration) error

WaitCluster blocks until Kubernetes appears to be healthy.

type ComponentExtraArgs added in v0.22.3

type ComponentExtraArgs struct {
	Component string
	Options   map[string]string
}

ComponentExtraArgs holds extra args for a component

func NewComponentExtraArgs added in v0.22.3

func NewComponentExtraArgs(opts config.ExtraOptionSlice, version semver.Version, featureGates string) ([]ComponentExtraArgs, error)

NewComponentExtraArgs creates a new ComponentExtraArgs

Jump to

Keyboard shortcuts

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