kubeadm: Tell the user when a static pod is created

This commit is contained in:
Lucas Käldström 2017-08-19 20:47:25 +03:00
parent eb207eb882
commit e4855bd1af
No known key found for this signature in database
GPG Key ID: 3FA3783D77751514
3 changed files with 12 additions and 3 deletions

View File

@ -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 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. // Warn about the limitations with the current cloudprovider solution.
if cfg.CloudProvider != "" { if cfg.CloudProvider != "" {
@ -272,7 +272,7 @@ func (i *Init) Run(out io.Writer) error {
// PHASE 5: Set up the node bootstrap tokens // PHASE 5: Set up the node bootstrap tokens
if !i.skipTokenPrint { 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 // Create the default node bootstrap token

View File

@ -125,6 +125,8 @@ func createStaticPodFiles(manifestDir string, cfg *kubeadmapi.MasterConfiguratio
if err := staticpodutil.WriteStaticPodToDisk(componentName, manifestDir, spec); err != nil { if err := staticpodutil.WriteStaticPodToDisk(componentName, manifestDir, spec); err != nil {
return fmt.Errorf("failed to create static pod manifest file for %q: %v", componentName, err) 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 return nil

View File

@ -17,6 +17,8 @@ limitations under the License.
package etcd package etcd
import ( import (
"fmt"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants" kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
@ -35,7 +37,12 @@ func CreateLocalEtcdStaticPodManifestFile(manifestDir string, cfg *kubeadmapi.Ma
spec := GetEtcdPodSpec(cfg) spec := GetEtcdPodSpec(cfg)
// writes etcd StaticPod to disk // 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 // GetEtcdPodSpec returns the etcd static Pod actualized to the context of the current MasterConfiguration