Rancher supports provisioning Amazon EC2 hosts using
Before launching a host on AWS, you’ll need to find your AWS account credentials as well as your security group information. The Account Access information can be found using Amazon’s documentation to find the correct keys. When creating an access key and secret key, please be sure to save it somewhere as it will not be available unless you create a new key pair.
Under the Infrastructure -> Hosts tab, click Add Host. Select the Amazon EC2 icon. Provide your AWS Access key and Secret Key, click on Next: Authenticate & select a network. Rancher will use your credentials to determine what is available in AWS to launch instances.
You’ll need to select the available region and zone to create the instance. Depending on which region/zone that you select, the available VPC IDs and Subnet IDs will be displayed. Select a VPC ID or Subnet ID, and click on Next: Select a Security Group.
Next, you’ll select a security group to use for the hosts. There are two choices for security groups. The Standard option will create or use the existing
rancher-machine security group. If Rancher creates the
rancher-machine security group, it will open up all the necessary ports to allow Rancher to work successfully.
docker machine will automatically open up port
2376, which is the Docker daemon port.
In the Custom option, you can choose an existing security group, but you will need to ensure that specific ports are open in order for Rancher to be working correctly.
22(SSH to install and configure Docker)
4500(for IPsec networking)
Note: If you re-use the
rancher-machinesecurity group, any missing ports in the security group will not be re-opened. You will need to check the security group in AWS if the host does not launch correctly.
After choosing your security option, click on Next: Set Instance Options.
Finally, you’ll just need to finish filling out the final details of the host(s).
docker machineis 16GB, which is what we have defaulted in Rancher.
docker machinedefaults with an Ubuntu 14.04 LTS image in the specific region. You also have the option to select your own AMI. If you input your own AMI, make sure it’s available in that region!
docker-machine createcommand with Docker engine options.
Rancher will create the EC2 instance(s) and launch the rancher-agent container in the instance. In a couple of minutes, the host will be active and available for services.