- joinRunner.AppendPhase(phases.NewPreflightPhase()) // 1.环境检查
- joinRunner.AppendPhase(phases.NewControlPlanePreparePhase()) // 2.控制面准备
- joinRunner.AppendPhase(phases.NewCheckEtcdPhase()) // 3.检查etcd是否健康
- joinRunner.AppendPhase(phases.NewKubeletStartPhase()) // 4.启动kubelet
- joinRunner.AppendPhase(phases.NewControlPlaneJoinPhase()) // 5.控制面操作
joinRunner.AppendPhase(phases.NewPreflightPhase()) // 1.环境检查
RunJoinNodeChecks
- DirAvailableCheck
- FileAvailableCheck kubelet.conf
- FileAvailableCheck bootstrap-kubelet.conf
��
InitCfg 从apiserver查询 InitConfiguration
- TLSBootstrapCfg:先查 kube-public/cluster-info�
- fetchInitConfigurationFromJoinConfiguration:查询configmap kube-system/kubeadm-config
�
如果需要controllerPlane,代表启动一个master节点
- checkIfReadyForAdditionalControlPlane
- RunInitNodeChecks
joinRunner.AppendPhase(phases.NewControlPlanePreparePhase()) // 2.控制面准备
joinRunner.AppendPhase(phases.NewCheckEtcdPhase()) // 3.检查etcd是否健康
joinRunner.AppendPhase(phases.NewKubeletStartPhase()) // 4.启动kubelet
kubeconfigutil.WriteToDisk:TLSBootstrapCfg 写入bootstrap-kubelet.conf。 defer会删掉这个文件
certutil.WriteCert:把cluster-info中�CA证书写入 /etc/kubernetes/pki/ca.crt
�TryStopKubelet
kubeletphase.WriteConfigToDisk:�把kubeadm ClusterConfiguration写入 /var/lib/kubelet/config.yaml
WriteKubeletDynamicEnvFile
�TryStartKubelet
NewKubeWaiter
�
�