Make none driver work with kubeadm

pull/2352/merge
Matt Rickard 2017-12-21 13:28:08 -08:00 committed by dlorenc
parent 43f89494f0
commit 4077763003
3 changed files with 14 additions and 3 deletions

View File

@ -260,7 +260,7 @@ func runStart(cmd *cobra.Command, args []string) {
fmt.Println("Starting cluster components...")
if !exists {
if !exists || config.VMDriver == "none" {
if err := k8sBootstrapper.StartCluster(kubernetesConfig); err != nil {
glog.Errorln("Error starting cluster: ", err)
cmdutil.MaybeReportErrorAndExit(err)

View File

@ -25,6 +25,7 @@ import (
"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/state"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/net"
pkgdrivers "k8s.io/minikube/pkg/drivers"
"k8s.io/minikube/pkg/minikube/constants"
)
@ -72,7 +73,11 @@ func (d *Driver) DriverName() string {
}
func (d *Driver) GetIP() (string, error) {
return "127.0.0.1", nil
ip, err := net.ChooseBindAddress(nil)
if err != nil {
return "", err
}
return ip.String(), nil
}
func (d *Driver) GetSSHHostname() (string, error) {
@ -84,7 +89,12 @@ func (d *Driver) GetSSHPort() (int, error) {
}
func (d *Driver) GetURL() (string, error) {
return "tcp://127.0.0.1:2376", nil
ip, err := d.GetIP()
if err != nil {
return "", err
}
return fmt.Sprintf("tcp://%s:2376", ip), nil
}
func (d *Driver) GetState() (state.State, error) {

View File

@ -174,6 +174,7 @@ var versionSpecificOpts = []VersionedExtraOption{
NewUnversionedOption(Kubelet, "kubeconfig", "/etc/kubernetes/kubelet.conf"),
NewUnversionedOption(Kubelet, "bootstrap-kubeconfig", "/etc/kubernetes/bootstrap-kubelet.conf"),
NewUnversionedOption(Kubelet, "require-kubeconfig", "true"),
NewUnversionedOption(Kubelet, "hostname-override", "minikube"),
// System pods args
NewUnversionedOption(Kubelet, "pod-manifest-path", "/etc/kubernetes/manifests"),