Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultOptionsForComponentAndVersion(component string, version semver.Version) (map[string]string, error)
- func ExtraConfigForComponent(component string, opts config.ExtraOptionSlice, version semver.Version) (map[string]string, error)
- func NewKubeletConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, error)
- func NewKubeletService(cfg config.KubernetesConfig) ([]byte, error)
- func ParseFeatureArgs(featureGates string) (map[string]bool, string, error)
- func Supports(featureName string) bool
- func VersionIsBetween(version, gte, lte semver.Version) bool
- type Bootstrapper
- func (k *Bootstrapper) DeleteCluster(k8s config.KubernetesConfig) error
- func (k *Bootstrapper) GetAPIServerStatus(ip net.IP, apiserverPort int) (string, error)
- func (k *Bootstrapper) GetKubeletStatus() (string, error)
- func (k *Bootstrapper) LogCommands(o bootstrapper.LogOptions) map[string]string
- func (k *Bootstrapper) PullImages(k8s config.KubernetesConfig) error
- func (k *Bootstrapper) RestartCluster(k8s config.KubernetesConfig) error
- func (k *Bootstrapper) SetupCerts(k8s config.KubernetesConfig) error
- func (k *Bootstrapper) StartCluster(k8s config.KubernetesConfig) error
- func (k *Bootstrapper) UpdateCluster(cfg config.KubernetesConfig) error
- func (k *Bootstrapper) WaitForPods(k8s config.KubernetesConfig, timeout time.Duration, podsToWaitFor []string) error
- type ComponentExtraArgs
Constants ¶
const ( KubeadmCmdParam = iota KubeadmConfigParam = iota AllPods = "ALL_PODS" )
enum to differentiate kubeadm command line parameters from kubeadm config file parameters (see the KubeadmExtraArgsWhitelist variable below for more info)
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 ¶
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
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
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
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
ParseFeatureArgs parses feature args into extra args
func Supports ¶ added in v0.28.1
Supports indicates whether a feature name is supported on the feature gates for kubeadm
func VersionIsBetween ¶ added in v0.22.3
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
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) WaitForPods ¶ added in v1.5.1
func (k *Bootstrapper) WaitForPods(k8s config.KubernetesConfig, timeout time.Duration, podsToWaitFor []string) error
WaitForPods blocks until pods specified in podsToWaitFor appear to be healthy.
type ComponentExtraArgs ¶ added in v0.22.3
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