Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAndInstallKubeadm(kubernetesResourceServer, clusterVersion string) error
- func CheckAndInstallKubelet(kubernetesResourceServer, clusterVersion string) error
- func CheckAndInstallKubernetesCni(reuseCNIBin bool) error
- func CheckKubeletStatus() error
- func EnableKubeletService() error
- func GetDefaultClientSet() (*kubernetes.Clientset, error)
- func GetKubernetesVersionFromCluster(client kubernetes.Interface) (string, error)
- func GetStaticPodTemplateFromConfigMap(client kubernetes.Interface, namespace, name string) (string, string, error)
- func IsValidBootstrapToken(token string) bool
- func RetrieveBootstrapConfig(data joindata.YurtJoinData) (*clientcmdapi.Config, error)
- func RunJobAndCleanup(cliSet *kubernetes.Clientset, job *batchv1.Job, timeout, period time.Duration, ...) error
- func SetDiscoveryConfig(data joindata.YurtJoinData) error
- func SetKubeadmJoinConfig(data joindata.YurtJoinData) error
- func SetKubeletConfigForNode() error
- func SetKubeletService() error
- func SetKubeletUnitConfig() error
Constants ¶
const ( TmpDownloadDir = "/tmp" // TokenUser defines token user TokenUser = "tls-bootstrap-token-user" )
Variables ¶
var ( // PropagationPolicy defines the propagation policy used when deleting a resource PropagationPolicy = metav1.DeletePropagationBackground ErrClusterVersionEmpty = errors.New("cluster version should not be empty") // BootstrapTokenRegexp is a compiled regular expression of TokenRegexpString BootstrapTokenRegexp = regexp.MustCompile(constants.BootstrapTokenPattern) )
Functions ¶
func CheckAndInstallKubeadm ¶ added in v1.2.0
CheckAndInstallKubeadm install kubeadm, skip install if it exist.
func CheckAndInstallKubelet ¶
CheckAndInstallKubelet install kubelet and kubernetes-cni, skip install if they exist.
func CheckAndInstallKubernetesCni ¶ added in v1.2.0
CheckAndInstallKubernetesCni install kubernetes-cni, skip install if they exist.
func CheckKubeletStatus ¶ added in v1.3.0
func CheckKubeletStatus() error
CheckKubeletStatus check if kubelet is healthy.
func EnableKubeletService ¶ added in v1.4.0
func EnableKubeletService() error
EnableKubeletService enable kubelet service
func GetDefaultClientSet ¶ added in v1.4.0
func GetDefaultClientSet() (*kubernetes.Clientset, error)
GetDefaultClientSet return client set created by /etc/kubernetes/kubelet.conf
func GetKubernetesVersionFromCluster ¶
func GetKubernetesVersionFromCluster(client kubernetes.Interface) (string, error)
GetKubernetesVersionFromCluster get kubernetes cluster version from master.
func GetStaticPodTemplateFromConfigMap ¶ added in v1.4.0
func GetStaticPodTemplateFromConfigMap(client kubernetes.Interface, namespace, name string) (string, string, error)
GetStaticPodTemplateFromConfigMap get static pod template from configmap
func IsValidBootstrapToken ¶ added in v1.4.0
IsValidBootstrapToken returns whether the given string is valid as a Bootstrap Token and in other words satisfies the BootstrapTokenRegexp
func RetrieveBootstrapConfig ¶ added in v1.2.0
func RetrieveBootstrapConfig(data joindata.YurtJoinData) (*clientcmdapi.Config, error)
RetrieveBootstrapConfig get clientcmdapi config by bootstrap token
func RunJobAndCleanup ¶
func RunJobAndCleanup(cliSet *kubernetes.Clientset, job *batchv1.Job, timeout, period time.Duration, waitForTimeout bool) error
RunJobAndCleanup runs the job, wait for it to be complete, and delete it
func SetDiscoveryConfig ¶ added in v1.2.0
func SetDiscoveryConfig(data joindata.YurtJoinData) error
func SetKubeadmJoinConfig ¶ added in v1.2.0
func SetKubeadmJoinConfig(data joindata.YurtJoinData) error
func SetKubeletConfigForNode ¶
func SetKubeletConfigForNode() error
SetKubeletConfigForNode write kubelet.conf for join node.
func SetKubeletService ¶
func SetKubeletService() error
SetKubeletService configure kubelet service.
func SetKubeletUnitConfig ¶
func SetKubeletUnitConfig() error
SetKubeletUnitConfig configure kubelet startup parameters.
Types ¶
This section is empty.