I’m relatively new to using Rancher (and containers in general) so forgive my lack of experience here. I’ve been creating hosts via Rancher GUI in AWS pretty easily, but Rancher creates keypairs for those EC2 instances that I’d have to download manually to ssh to the hosts if need be. We already have a shared keypair that we use for other EC2 instances, that i’m trying to see if i can launch a host using that. My syntax seems correct and I have the file uploaded to the rancher/server container, but keep getting this message
Error with pre-create check: “There is no keypair with the name dlvr-devops. Please verify the key name provided.”
Below is the example CLI script i’m using:
#!/bin/bash ./rancher host create --driver amazonec2 \ --amazonec2-access-key access-key \ --amazonec2-secret-key secret-key \ --amazonec2-region us-west-2 \ --amazonec2-vpc-id vpc-name \ --amazonec2-security-group rancher-machine \ --name lab-pdx-2 \ --amazonec2-instance-type t2.micro \ --amazonec2-ssh-keypath /tmp/dlvr-devops \ --amazonec2-keypair-name dlvr-devops
- Is this even possible what I’m trying to-do?
- Is my syntax off?
- If I can’t do this, anyone have an example how they’re managing the individual key-pairs that are generated per host without having to manually download?