mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #75027 from ping035627/k8s-190306
Add some logs for kubeadm join
This commit is contained in:
commit
3c9c7fca64
@ -101,8 +101,8 @@ func runKubeletStartJoinPhase(c workflow.RunData) error {
|
|||||||
}
|
}
|
||||||
bootstrapKubeConfigFile := kubeadmconstants.GetBootstrapKubeletKubeConfigPath()
|
bootstrapKubeConfigFile := kubeadmconstants.GetBootstrapKubeletKubeConfigPath()
|
||||||
|
|
||||||
// Write the bootstrap kubelet config file or the TLS-Boostrapped kubelet config file down to disk
|
// Write the bootstrap kubelet config file or the TLS-Bootstrapped kubelet config file down to disk
|
||||||
klog.V(1).Infoln("[kubelet-start] writing bootstrap kubelet config file at", bootstrapKubeConfigFile)
|
klog.V(1).Infof("[kubelet-start] writing bootstrap kubelet config file at %s", bootstrapKubeConfigFile)
|
||||||
if err := kubeconfigutil.WriteToDisk(bootstrapKubeConfigFile, tlsBootstrapCfg); err != nil {
|
if err := kubeconfigutil.WriteToDisk(bootstrapKubeConfigFile, tlsBootstrapCfg); err != nil {
|
||||||
return errors.Wrap(err, "couldn't save bootstrap-kubelet.conf to disk")
|
return errors.Wrap(err, "couldn't save bootstrap-kubelet.conf to disk")
|
||||||
}
|
}
|
||||||
@ -110,6 +110,7 @@ func runKubeletStartJoinPhase(c workflow.RunData) error {
|
|||||||
// Write the ca certificate to disk so kubelet can use it for authentication
|
// Write the ca certificate to disk so kubelet can use it for authentication
|
||||||
cluster := tlsBootstrapCfg.Contexts[tlsBootstrapCfg.CurrentContext].Cluster
|
cluster := tlsBootstrapCfg.Contexts[tlsBootstrapCfg.CurrentContext].Cluster
|
||||||
if _, err := os.Stat(cfg.CACertPath); os.IsNotExist(err) {
|
if _, err := os.Stat(cfg.CACertPath); os.IsNotExist(err) {
|
||||||
|
klog.V(1).Infof("[kubelet-start] writing CA certificate at %s", cfg.CACertPath)
|
||||||
if err := certutil.WriteCert(cfg.CACertPath, tlsBootstrapCfg.Clusters[cluster].CertificateAuthorityData); err != nil {
|
if err := certutil.WriteCert(cfg.CACertPath, tlsBootstrapCfg.Clusters[cluster].CertificateAuthorityData); err != nil {
|
||||||
return errors.Wrap(err, "couldn't save the CA certificate to disk")
|
return errors.Wrap(err, "couldn't save the CA certificate to disk")
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ func runPreflight(c workflow.RunData) error {
|
|||||||
return errors.New(msg.String())
|
return errors.New(msg.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
// run kubeadm init preflight checks for checking all the prequisites
|
// run kubeadm init preflight checks for checking all the prerequisites
|
||||||
fmt.Println("[preflight] Running pre-flight checks before initializing the new control plane instance")
|
fmt.Println("[preflight] Running pre-flight checks before initializing the new control plane instance")
|
||||||
if err := preflight.RunInitNodeChecks(utilsexec.New(), initCfg, j.IgnorePreflightErrors(), true); err != nil {
|
if err := preflight.RunInitNodeChecks(utilsexec.New(), initCfg, j.IgnorePreflightErrors(), true); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user