@@ -17,12 +17,12 @@ import (
1717 "github.com/k0sproject/dig"
1818 "github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1"
1919 "github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster"
20+ "github.com/k0sproject/rig"
2021 "github.com/sirupsen/logrus"
2122 "gopkg.in/yaml.v2"
2223
2324 "github.com/replicatedhq/helmvm/pkg/defaults"
2425 "github.com/replicatedhq/helmvm/pkg/infra"
25- "github.com/replicatedhq/helmvm/pkg/ssh"
2626)
2727
2828// ReadConfigFile reads the cluster configuration from the provided file.
@@ -307,28 +307,17 @@ func generateConfigForHosts(lb string, hosts ...*cluster.Host) (*v1beta1.Cluster
307307// renderSingleNodeConfig renders a configuration to allow k0sctl to install in the localhost
308308// in a single-node configuration.
309309func renderSingleNodeConfig (ctx context.Context ) (* v1beta1.Cluster , error ) {
310- usr , err := user .Current ()
311- if err != nil {
312- return nil , fmt .Errorf ("unable to get current user: %w" , err )
313- }
314- if err := ssh .AllowLocalSSH (); err != nil {
315- return nil , fmt .Errorf ("unable to allow localhost SSH: %w" , err )
316- }
317- ipaddr , err := defaults .PreferredNodeIPAddress ()
318- if err != nil {
319- return nil , fmt .Errorf ("unable to get preferred node IP address: %w" , err )
320- }
321- host := & hostcfg {
322- Address : ipaddr ,
323- Role : "controller+worker" ,
324- Port : 22 ,
325- User : usr .Username ,
326- KeyPath : defaults .SSHKeyPath (),
327- }
328- if err := host .testConnection (); err != nil {
329- return nil , fmt .Errorf ("unable to connect to %s: %w" , ipaddr , err )
310+ rhost := & cluster.Host {
311+ Role : "controller+worker" ,
312+ UploadBinary : true ,
313+ NoTaints : true ,
314+ InstallFlags : []string {"--disable-components konnectivity-server" },
315+ Connection : rig.Connection {
316+ Localhost : & rig.Localhost {
317+ Enabled : true ,
318+ },
319+ },
330320 }
331- rhost := host .render ()
332321 return generateConfigForHosts ("" , rhost )
333322}
334323
0 commit comments