joinRunner.AppendPhase(phases.NewPreflightPhase()) // 1.环境检查

RunJoinNodeChecks

  1. DirAvailableCheck
  2. FileAvailableCheck kubelet.conf
  3. FileAvailableCheck bootstrap-kubelet.conf

��
InitCfg 从apiserver查询 InitConfiguration

  1. TLSBootstrapCfg:先查 kube-public/cluster-info�
  2. fetchInitConfigurationFromJoinConfiguration:查询configmap kube-system/kubeadm-config


如果需要controllerPlane,代表启动一个master节点

  1. checkIfReadyForAdditionalControlPlane
  2. 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

joinRunner.AppendPhase(phases.NewControlPlaneJoinPhase()) // 5.控制面操作