diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 6c28fd002c4c5b81f92651d2d909ca2ae7bfa6ed..54822da71a0986706570c6b482bfb517409d06fc 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -350,7 +350,10 @@ This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_ } if !exists || config.VMDriver == constants.DriverNone { - fmt.Println("Starting cluster components...") + fmt.Println("Pulling images...") + if err := bs.PullImages(kubernetesConfig); err != nil { + fmt.Printf("Unable to pull images, which may be OK: %v", err) + } if err := bs.StartCluster(kubernetesConfig); err != nil { glog.Errorf("Error starting cluster: %v", err) cmdutil.MaybeReportErrorAndExit(err) diff --git a/pkg/drivers/none/none.go b/pkg/drivers/none/none.go index 235f04b502a4eb97946439de9590307b8bf78915..4298a96b63ba0ad8900ee65af35ebad5e04af94c 100644 --- a/pkg/drivers/none/none.go +++ b/pkg/drivers/none/none.go @@ -122,7 +122,7 @@ func (d *Driver) GetURL() (string, error) { // GetState returns the state that the host is in (running, stopped, etc) func (d *Driver) GetState() (state.State, error) { - if err := runningKubelet(d.exec); err != nil { + if err := checkKubelet(d.exec); err != nil { glog.Infof("kubelet not running: %v", err) return state.Stopped, nil } @@ -153,7 +153,7 @@ func (d *Driver) Remove() error { if err := d.Kill(); err != nil { return errors.Wrap(err, "kill") } - // TODO(tstromberg): Make sure this calls into the bootstrapper to perform `kubeadm reset` + // TODO(#3637): Make sure this calls into the bootstrapper to perform `kubeadm reset` cmd := fmt.Sprintf("sudo rm -rf %s", strings.Join(cleanupPaths, " ")) if err := d.exec.Run(cmd); err != nil { glog.Errorf("cleanup incomplete: %v", err) @@ -212,8 +212,8 @@ func restartKubelet(exec bootstrapper.CommandRunner) error { return exec.Run("sudo systemctl restart kubelet.service") } -// runningKubelet returns an error if the kubelet is not running. -func runningKubelet(exec bootstrapper.CommandRunner) error { +// checkKubelet returns an error if the kubelet is not running. +func checkKubelet(exec bootstrapper.CommandRunner) error { glog.Infof("checking for running kubelet ...") return exec.Run("systemctl is-active --quiet service kubelet") } diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 0855c93078a154b0bbbfdd3dc3474dafa8871a34..46c23060a307f8b52266de75caa8e7e544754c4b 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -74,7 +74,7 @@ func (r *Containerd) Disable() error { // LoadImage loads an image into this runtime func (r *Containerd) LoadImage(path string) error { - return nil + return pullImageCRI(r.Runner, path) } // KubeletOptions returns kubelet options for a containerd diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index 62d15fbbf9f0c8445e46e31674f616d59cb8287c..07a88475ea8fba23485c3d798f3fb76351fd7489 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -21,6 +21,8 @@ import ( "fmt" "html/template" "path" + + "github.com/golang/glog" ) // listCRIContainers returns a list of containers using crictl @@ -29,12 +31,18 @@ func listCRIContainers(_ CommandRunner, _ string) ([]string, error) { return []string{}, fmt.Errorf("unimplemented") } +// pullImageCRI uses ctr to pull images into a CRI runtime +func pullImageCRI(cr CommandRunner, path string) error { + glog.Infof("Loading image: %s", path) + return cr.Run(fmt.Sprintf("sudo ctr cri load %s", path)) +} + // criCRIContainers kills a list of containers using crictl func killCRIContainers(CommandRunner, []string) error { return fmt.Errorf("unimplemented") } -// StopCRIContainers stops containers using crictl +// stopCRIContainers stops containers using crictl func stopCRIContainers(CommandRunner, []string) error { return fmt.Errorf("unimplemented") } diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index e19ef91ee674453cb1dad9417f9ddfeae0f3ff35..4d81d6068989976c2636bd3abc3d9796ba68a425 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -73,7 +73,9 @@ func (r *CRIO) Disable() error { // LoadImage loads an image into this runtime func (r *CRIO) LoadImage(path string) error { + // This should use ctr via pullImageCRI once we sort out why api.v1.CRIPluginService is unimplemented. return r.Runner.Run(fmt.Sprintf("sudo podman load -i %s", path)) + } // KubeletOptions returns kubelet options for a runtime. diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 47807ccdb0020022566661b3010a50a57e5585f6..fb4f7bf6424ae71d3f212cef9589a398a5f54b3a 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -67,6 +67,7 @@ func (r *Docker) Disable() error { // LoadImage loads an image into this runtime func (r *Docker) LoadImage(path string) error { + glog.Infof("Loading image: %s", path) return r.Runner.Run(fmt.Sprintf("docker load -i %s", path)) }