kubeadm

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeRoleMaster = NodeRole("Master")
	NodeRoleWorker = NodeRole("Worker")
)
View Source
const (

	// WillUpgrade is value of label platform.tkestack.io/need-upgrade
	// machines with this value will upgrade it's node automatically one by one
	WillUpgrade = "willUpgrade"
)

Variables

View Source
var AddToScheme = localSchemeBuilder.AddToScheme
View Source
var Scheme = runtime.NewScheme()

Functions

func AddNeedUpgradeLabel added in v1.6.0

func AddNeedUpgradeLabel(platformClient platformv1client.PlatformV1Interface, clusterName, labelValue string) error

func ContainerLabelOfControlPlane added in v1.8.0

func ContainerLabelOfControlPlane(c *v1.Cluster, name string) string

func Init

func Init(s ssh.Interface, kubeadmConfig *InitConfig, phase string, preActions ...string) error

func Install

func Install(s ssh.Interface, option *Option) error

func Join added in v1.3.1

func Join(s ssh.Interface, config *kubeadmv1beta2.JoinConfiguration, phase string, endPointIPs []string) error

func MarkNextUpgradeWorkerNode added in v1.3.1

func MarkNextUpgradeWorkerNode(client kubernetes.Interface, platformClient platformv1client.PlatformV1Interface, version, clusterName string) error

markNextUpgradeWorkerNode marks next wokrer node to be upgraded.

func MarshalToYAML added in v1.3.1

func MarshalToYAML(obj runtime.Object) ([]byte, error)

MarshalToYaml marshals an object into yaml.

func RemoveUpgradeLabel added in v1.6.0

func RemoveUpgradeLabel(platformClient platformv1client.PlatformV1Interface, machine *platformv1.Machine) error

func RenewCerts added in v1.3.1

func RenewCerts(c *v1.Cluster, s ssh.Interface) error

func Reset added in v1.6.0

func Reset(s ssh.Interface, phase string) error

func RestartContainerByLabel added in v1.8.0

func RestartContainerByLabel(c *v1.Cluster, s ssh.Interface, label string) error

func RestartControlPlane added in v1.3.1

func RestartControlPlane(c *v1.Cluster, s ssh.Interface) error

func UpgradeNode added in v1.3.1

func UpgradeNode(s ssh.Interface, client kubernetes.Interface, platformClient platformv1client.PlatformV1Interface, logger log.Logger, cluster *v1.Cluster, option UpgradeOption) (upgraded bool, err error)

UpgradeNode upgrades node by kubeadm. Refer: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/

Types

type InitConfig added in v1.3.1

type InitConfig struct {
	InitConfiguration      *kubeadmv1beta2.InitConfiguration
	ClusterConfiguration   *kubeadmv1beta2.ClusterConfiguration
	KubeletConfiguration   *kubeletv1beta1.KubeletConfiguration
	KubeProxyConfiguration *kubeproxyv1alpha1.KubeProxyConfiguration
}

func (*InitConfig) Marshal added in v1.3.1

func (c *InitConfig) Marshal() ([]byte, error)

type NodeRole added in v1.3.1

type NodeRole string

type Option added in v1.8.0

type Option struct {
	RuntimeType platformv1.ContainerRuntimeType
	Version     string
}

type UpgradeOption added in v1.3.1

type UpgradeOption struct {
	MachineName            string
	BootstrapNode          bool
	MachineIP              string
	NodeRole               NodeRole
	Version                string
	MaxUnready             *intstr.IntOrString
	DrainNodeBeforeUpgrade *bool
}

Jump to

Keyboard shortcuts

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