Merge pull request #7494 from priyawadhwa/ssh-runner

Use SSH runner once SSH is set up in kic
pull/7513/head
Medya Ghazizadeh 2020-04-08 01:21:47 -07:00 committed by GitHub
commit 0e4b4d2d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -157,6 +157,11 @@ func CommandRunner(h *host.Host) (command.Runner, error) {
if driver.IsKIC(h.Driver.DriverName()) {
return command.NewKICRunner(h.Name, h.Driver.DriverName()), nil
}
return SSHRunner(h)
}
// SSHRunner returns an SSH runner for the host
func SSHRunner(h *host.Host) (command.Runner, error) {
client, err := sshutil.NewSSHClient(h.Driver)
if err != nil {
return nil, errors.Wrap(err, "getting ssh client for bootstrapper")

View File

@ -101,6 +101,18 @@ func Start(cc config.ClusterConfig, n config.Node, existingAddons map[string]boo
cr := configureRuntimes(mRunner, cc, sv)
showVersionInfo(n.KubernetesVersion, cr)
// ssh should be set up by now
// switch to using ssh runner since it is faster
if driver.IsKIC(cc.Driver) {
sshRunner, err := machine.SSHRunner(host)
if err != nil {
glog.Infof("error getting ssh runner: %v", err)
} else {
glog.Infof("Using ssh runner for kic...")
mRunner = sshRunner
}
}
var bs bootstrapper.Bootstrapper
var kcs *kubeconfig.Settings
if apiServer {