How to ssh/configure hosts created with Amazon/EC2 driver?

I’m successfully creating worker hosts from Rancher webui using Amazon/EC2 driver. However I can’t find a way to load my custom cloud-config.yml nor I can ssh to these hosts. Thus hosts get created, I can spawn my containers there but I can’t connect to them in case I need to debug.

Any ideas?

  1. you can ssh into each container you create in Rancher by viewing by container (a list) and on the right in the pulldown…

  2. you can ssh in each instance host you create in Rancher by viewing by host ( by tile) and at the top in the pulldown, select machine and the open the file you save locally and extract the id_rsa file. It works directly in ubuntu and you can convert it into ppk in windows, etc.

Thanks. I downloaded Machine Config in tar.gz format and used id_rsa, found in there, to login to the host:

However I find it incredibly inconvenient… Is there really no way to feed it my own cloud-config with my very own authorized_keys when I spawn hosts via Ec2 driver? :confused:

It’s not just ssh, I need these hosts to be custom configured.

I find it inconvenient as well. Not that I know of. You can assign security group but not access keys. Not sure why it has to be that way.

In all fairness, I believe the goal is to supply other solutions so you need not worry about that. Basically the catalogs are supposed to customize each machine as it gets built and the containers of course have there own customizations at deployment.

I find it amazing when it works correctly to just say add three instances and they all get configured correctly with all of the necessary elements without having to dynamically use compose and terraform. The api makes this simple. :slight_smile:

Well, I guess I can create my own AMIs with preinstalled appropriate /var/lib/rancher/conf/cloud-config.d/boot.yml and then tell Rancher to use that, but it would be a hack. It’s hard to comprehend, why there’s no such option in Rancher.

Some but not all docker-machine drivers provide a way to use an existing key, but that would require us to have the private key. If you install the Rancher CLI rancher ssh host_name pulls the key down and uses it automatically.