mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Implement kubeadm join
This commit is contained in:
parent
16e767d915
commit
12a394fcc7
@ -232,6 +232,16 @@ func runKubeletStartJoinPhase(c workflow.RunData) (returnErr error) {
|
|||||||
fmt.Println("[kubelet-start] Would stop the kubelet")
|
fmt.Println("[kubelet-start] Would stop the kubelet")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write the instance kubelet configuration file to disk.
|
||||||
|
if features.Enabled(initCfg.FeatureGates, features.NodeLocalCRISocket) {
|
||||||
|
kubeletConfig := &kubeletconfig.KubeletConfiguration{
|
||||||
|
ContainerRuntimeEndpoint: data.Cfg().NodeRegistration.CRISocket,
|
||||||
|
}
|
||||||
|
if err := kubeletphase.WriteInstanceConfigToDisk(kubeletConfig, data.KubeletDir()); err != nil {
|
||||||
|
return errors.Wrap(err, "error writing instance kubelet configuration to disk")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Write the configuration for the kubelet (using the bootstrap token credentials) to disk so the kubelet can start
|
// Write the configuration for the kubelet (using the bootstrap token credentials) to disk so the kubelet can start
|
||||||
if err := kubeletphase.WriteConfigToDisk(&initCfg.ClusterConfiguration, data.KubeletDir(), data.PatchesDir(), data.OutputWriter()); err != nil {
|
if err := kubeletphase.WriteConfigToDisk(&initCfg.ClusterConfiguration, data.KubeletDir(), data.PatchesDir(), data.OutputWriter()); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -323,9 +333,11 @@ func runKubeletWaitBootstrapPhase(c workflow.RunData) (returnErr error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
klog.V(1).Infoln("[kubelet-start] preserving the crisocket information for the node")
|
if !features.Enabled(initCfg.ClusterConfiguration.FeatureGates, features.NodeLocalCRISocket) {
|
||||||
if err := patchnodephase.AnnotateCRISocket(client, cfg.NodeRegistration.Name, cfg.NodeRegistration.CRISocket); err != nil {
|
klog.V(1).Infoln("[kubelet-start] preserving the crisocket information for the node")
|
||||||
return errors.Wrap(err, "error uploading crisocket")
|
if err := patchnodephase.AnnotateCRISocket(client, cfg.NodeRegistration.Name, cfg.NodeRegistration.CRISocket); err != nil {
|
||||||
|
return errors.Wrap(err, "error writing CRISocket for this node")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user