From e4855bd1af4f7f4cee2be715888df41d0a8e2127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Sat, 19 Aug 2017 20:47:25 +0300 Subject: [PATCH] kubeadm: Tell the user when a static pod is created --- cmd/kubeadm/app/cmd/init.go | 4 ++-- cmd/kubeadm/app/phases/controlplane/manifests.go | 2 ++ cmd/kubeadm/app/phases/etcd/local.go | 9 ++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/kubeadm/app/cmd/init.go b/cmd/kubeadm/app/cmd/init.go index 39f1c8b7adb..56b640d813b 100644 --- a/cmd/kubeadm/app/cmd/init.go +++ b/cmd/kubeadm/app/cmd/init.go @@ -188,7 +188,7 @@ func NewInit(cfgPath string, cfg *kubeadmapi.MasterConfiguration, skipPreFlight, } fmt.Printf("[init] Using Kubernetes version: %s\n", cfg.KubernetesVersion) - fmt.Printf("[init] Using Authorization mode: %v\n", cfg.AuthorizationModes) + fmt.Printf("[init] Using Authorization modes: %v\n", cfg.AuthorizationModes) // Warn about the limitations with the current cloudprovider solution. if cfg.CloudProvider != "" { @@ -272,7 +272,7 @@ func (i *Init) Run(out io.Writer) error { // PHASE 5: Set up the node bootstrap tokens if !i.skipTokenPrint { - fmt.Printf("[token] Using token: %s\n", i.cfg.Token) + fmt.Printf("[bootstraptoken] Using token: %s\n", i.cfg.Token) } // Create the default node bootstrap token diff --git a/cmd/kubeadm/app/phases/controlplane/manifests.go b/cmd/kubeadm/app/phases/controlplane/manifests.go index ed073cedd5f..4dbff920f4e 100644 --- a/cmd/kubeadm/app/phases/controlplane/manifests.go +++ b/cmd/kubeadm/app/phases/controlplane/manifests.go @@ -125,6 +125,8 @@ func createStaticPodFiles(manifestDir string, cfg *kubeadmapi.MasterConfiguratio if err := staticpodutil.WriteStaticPodToDisk(componentName, manifestDir, spec); err != nil { return fmt.Errorf("failed to create static pod manifest file for %q: %v", componentName, err) } + + fmt.Printf("[controlplane] Wrote Static Pod manifest for component %s to %q\n", componentName, kubeadmconstants.GetStaticPodFilepath(componentName, manifestDir)) } return nil diff --git a/cmd/kubeadm/app/phases/etcd/local.go b/cmd/kubeadm/app/phases/etcd/local.go index 17f2af83814..94cdecf4bac 100644 --- a/cmd/kubeadm/app/phases/etcd/local.go +++ b/cmd/kubeadm/app/phases/etcd/local.go @@ -17,6 +17,8 @@ limitations under the License. package etcd import ( + "fmt" + "k8s.io/api/core/v1" kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants" @@ -35,7 +37,12 @@ func CreateLocalEtcdStaticPodManifestFile(manifestDir string, cfg *kubeadmapi.Ma spec := GetEtcdPodSpec(cfg) // writes etcd StaticPod to disk - return staticpodutil.WriteStaticPodToDisk(kubeadmconstants.Etcd, manifestDir, spec) + if err := staticpodutil.WriteStaticPodToDisk(kubeadmconstants.Etcd, manifestDir, spec); err != nil { + return err + } + + fmt.Printf("[etcd] Wrote Static Pod manifest for a local etcd instance to %q\n", kubeadmconstants.GetStaticPodFilepath(kubeadmconstants.Etcd, manifestDir)) + return nil } // GetEtcdPodSpec returns the etcd static Pod actualized to the context of the current MasterConfiguration