kubeadm

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

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 PodsByLayer = []pod{
	{"apiserver", "component", "kube-apiserver"},
	{"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.

View Source
var SkipPreflights = []string{

	"DirAvailable--etc-kubernetes-manifests",
	"DirAvailable--data-minikube",
	"Port-10250",
	"FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml",
	"FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml",
	"FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml",
	"FileAvailable--etc-kubernetes-manifests-etcd.yaml",

	"Swap",

	"CRI",
}

SkipPreflights are preflight checks we always skip.

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 util.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) (string, error)

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

func ParseFeatureArgs added in v0.28.1

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

ParseFeatureArgs parses feature args into extra args

func ParseKubernetesVersion added in v0.22.3

func ParseKubernetesVersion(version string) (semver.Version, error)

ParseKubernetesVersion parses the kubernetes version

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

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 util.ExtraOptionSlice, version semver.Version, featureGates string) ([]ComponentExtraArgs, error)

NewComponentExtraArgs creates a new ComponentExtraArgs

type VersionedExtraOption added in v0.22.3

type VersionedExtraOption struct {

	// The flag and component that will be set
	Option util.ExtraOption

	// This flag will only be applied to versions before or equal to this version
	// If it is the default value, it will have no upper bound on versions the
	// flag is applied to
	LessThanOrEqual semver.Version

	// The flag will only be applied to versions after or equal to this version
	// If it is the default value, it will have no lower bound on versions the
	// flag is applied to
	GreaterThanOrEqual semver.Version
}

VersionedExtraOption holds information on flags to apply to a specific range of versions

func NewUnversionedOption added in v0.23.0

func NewUnversionedOption(component, k, v string) VersionedExtraOption

NewUnversionedOption returns a VersionedExtraOption that applies to all versions.

Jump to

Keyboard shortcuts

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