This PR introduces caching of localkube images. It makes a best effort
to cache the essential images localkube needs as minikube starts up.
Currently, the list of cached images is hardcoded, but future work might
entail
1. Cached images as a property of the cluster bootstrapper - to allow
localkube and kubeadm to cache their respective images.
2. Addons contain image information. Then, we can selectively cache and
preload only the addon images that are enabled.
Introduce the --bootstraper or -b flag that toggles the cluster
bootstrapper. The default bootstrapper (and only bootstrapper at this
time) is localkube.
The bootstrapper interface contains all the functions needed to
bootstrap a kubernetes cluster. It ingests a KubernetesConfig, which
contains all the configuration for the cluster, as well as a
CommandRunner, which is the interface upon which it will run commands
and transfer files to possibly remotely set up the cluster.
This moves the localkube functions out of cluster.go into their own
package at k8s.io/minikube/pkg/minikube/bootstrapper/localkube.
Two implementations, SSHRunner and ExecRunner allow commands to be run
either through SSH or os.Exec respectively. This allows the cluster
bootstrappers to be unaware of how they are actually executing the
commands they need. Copy and Remove functions provide a nice
convenience function for running commands that copy and remove files
respectively.
The current implementation assumes that we already have docker running.
This switches it to not remove any previous docker configuration
(since there isn't any), and uses our native file transfer utils
instead of the printf commands.
- Create Config struct to store MachineConfig and KubernetesConfig as cluster
configuration.
- Write cluster configuration under $MINIKUBE_HOME/profiles/ directory
when a cluster is launched.
- Load the cluster configuration at `start` and compare the loaded k8s
version with the requested version. Prevent any version downgrade requests.