Merge branch 'master' of https://github.com/kubernetes/minikube into update-kubeadm-v1beta2
commit
975f720518
|
@ -400,7 +400,7 @@ func HostPortBinding(ociBinary string, ociID string, contPort int) (int, error)
|
||||||
cmd := exec.Command(ociBinary, "inspect", "-f", fmt.Sprintf("'{{(index (index .NetworkSettings.Ports \"%d/tcp\") 0).HostPort}}'", contPort), ociID)
|
cmd := exec.Command(ociBinary, "inspect", "-f", fmt.Sprintf("'{{(index (index .NetworkSettings.Ports \"%d/tcp\") 0).HostPort}}'", contPort), ociID)
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "getting host-bind port %q for container ID %q", contPort, ociID)
|
return 0, errors.Wrapf(err, "getting host-bind port %d for container ID %q, output %s", contPort, ociID, out)
|
||||||
}
|
}
|
||||||
o := strings.Trim(string(out), "\n")
|
o := strings.Trim(string(out), "\n")
|
||||||
o = strings.Trim(o, "'")
|
o = strings.Trim(o, "'")
|
||||||
|
|
|
@ -39,6 +39,7 @@ import (
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
kconst "k8s.io/kubernetes/cmd/kubeadm/app/constants"
|
kconst "k8s.io/kubernetes/cmd/kubeadm/app/constants"
|
||||||
"k8s.io/minikube/pkg/drivers/kic"
|
"k8s.io/minikube/pkg/drivers/kic"
|
||||||
|
"k8s.io/minikube/pkg/drivers/kic/oci"
|
||||||
"k8s.io/minikube/pkg/kapi"
|
"k8s.io/minikube/pkg/kapi"
|
||||||
"k8s.io/minikube/pkg/minikube/assets"
|
"k8s.io/minikube/pkg/minikube/assets"
|
||||||
"k8s.io/minikube/pkg/minikube/bootstrapper"
|
"k8s.io/minikube/pkg/minikube/bootstrapper"
|
||||||
|
@ -249,7 +250,7 @@ func (k *Bootstrapper) StartCluster(cfg config.MachineConfig) error {
|
||||||
if !driver.IsKIC(cfg.VMDriver) { // TODO: skip for both after verifications https://github.com/kubernetes/minikube/issues/6239
|
if !driver.IsKIC(cfg.VMDriver) { // TODO: skip for both after verifications https://github.com/kubernetes/minikube/issues/6239
|
||||||
glog.Infof("Configuring cluster permissions ...")
|
glog.Infof("Configuring cluster permissions ...")
|
||||||
elevate := func() error {
|
elevate := func() error {
|
||||||
client, err := k.client(cp)
|
client, err := k.client(cp.IP, cp.Port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -269,7 +270,7 @@ func (k *Bootstrapper) StartCluster(cfg config.MachineConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// client sets and returns a Kubernetes client to use to speak to a kubeadm launched apiserver
|
// client sets and returns a Kubernetes client to use to speak to a kubeadm launched apiserver
|
||||||
func (k *Bootstrapper) client(n config.Node) (*kubernetes.Clientset, error) {
|
func (k *Bootstrapper) client(ip string, port int) (*kubernetes.Clientset, error) {
|
||||||
if k.k8sClient != nil {
|
if k.k8sClient != nil {
|
||||||
return k.k8sClient, nil
|
return k.k8sClient, nil
|
||||||
}
|
}
|
||||||
|
@ -279,7 +280,7 @@ func (k *Bootstrapper) client(n config.Node) (*kubernetes.Clientset, error) {
|
||||||
return nil, errors.Wrap(err, "client config")
|
return nil, errors.Wrap(err, "client config")
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoint := fmt.Sprintf("https://%s", net.JoinHostPort(n.IP, strconv.Itoa(n.Port)))
|
endpoint := fmt.Sprintf("https://%s", net.JoinHostPort(ip, strconv.Itoa(port)))
|
||||||
if cc.Host != endpoint {
|
if cc.Host != endpoint {
|
||||||
glog.Errorf("Overriding stale ClientConfig host %s with %s", cc.Host, endpoint)
|
glog.Errorf("Overriding stale ClientConfig host %s with %s", cc.Host, endpoint)
|
||||||
cc.Host = endpoint
|
cc.Host = endpoint
|
||||||
|
@ -302,11 +303,21 @@ func (k *Bootstrapper) WaitForCluster(cfg config.MachineConfig, timeout time.Dur
|
||||||
if err := kverify.APIServerProcess(k.c, start, timeout); err != nil {
|
if err := kverify.APIServerProcess(k.c, start, timeout); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := kverify.APIServerIsRunning(start, cp.IP, cp.Port, timeout); err != nil {
|
|
||||||
|
ip := cp.IP
|
||||||
|
port := cp.Port
|
||||||
|
if driver.IsKIC(cfg.VMDriver) {
|
||||||
|
ip = kic.DefaultBindIPV4
|
||||||
|
port, err = oci.HostPortBinding(cfg.VMDriver, cfg.Name, port)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "get host-bind port %d for container %s", port, cfg.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err := kverify.APIServerIsRunning(start, ip, port, timeout); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
c, err := k.client(cp)
|
c, err := k.client(ip, port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "get k8s client")
|
return errors.Wrap(err, "get k8s client")
|
||||||
}
|
}
|
||||||
|
@ -361,7 +372,7 @@ func (k *Bootstrapper) restartCluster(cfg config.MachineConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, n := range cfg.Nodes {
|
for _, n := range cfg.Nodes {
|
||||||
client, err := k.client(n)
|
client, err := k.client(n.IP, n.Port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "getting k8s client")
|
return errors.Wrap(err, "getting k8s client")
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,12 +43,13 @@ func init() {
|
||||||
|
|
||||||
func configure(mc config.MachineConfig) interface{} {
|
func configure(mc config.MachineConfig) interface{} {
|
||||||
return kic.NewDriver(kic.Config{
|
return kic.NewDriver(kic.Config{
|
||||||
MachineName: mc.Name,
|
MachineName: mc.Name,
|
||||||
StorePath: localpath.MiniPath(),
|
StorePath: localpath.MiniPath(),
|
||||||
ImageDigest: kic.BaseImage,
|
ImageDigest: kic.BaseImage,
|
||||||
CPU: mc.CPUs,
|
CPU: mc.CPUs,
|
||||||
Memory: mc.Memory,
|
Memory: mc.Memory,
|
||||||
OCIBinary: oci.Docker,
|
OCIBinary: oci.Docker,
|
||||||
|
APIServerPort: mc.Nodes[0].Port,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ The `minikube start` command supports 3 additional kvm specific flags:
|
||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
* `minikube` will repeatedly for the root password if user is not in the correct `libvirt` group [#3467](https://github.com/kubernetes/minikube/issues/3467)
|
* `minikube` will repeatedly ask for the root password if user is not in the correct `libvirt` group [#3467](https://github.com/kubernetes/minikube/issues/3467)
|
||||||
* `Machine didn't return an IP after 120 seconds` when firewall prevents VM network access [#3566](https://github.com/kubernetes/minikube/issues/3566)
|
* `Machine didn't return an IP after 120 seconds` when firewall prevents VM network access [#3566](https://github.com/kubernetes/minikube/issues/3566)
|
||||||
* `unable to set user and group to '65534:992` when `dynamic ownership = 1` in `qemu.conf` [#4467](https://github.com/kubernetes/minikube/issues/4467)
|
* `unable to set user and group to '65534:992` when `dynamic ownership = 1` in `qemu.conf` [#4467](https://github.com/kubernetes/minikube/issues/4467)
|
||||||
* KVM VM's cannot be used simultaneously with VirtualBox [#4913](https://github.com/kubernetes/minikube/issues/4913)
|
* KVM VM's cannot be used simultaneously with VirtualBox [#4913](https://github.com/kubernetes/minikube/issues/4913)
|
||||||
|
|
Loading…
Reference in New Issue