Launching RancherOS on AWS EC2
Welcome back to another episode of Continuous Improvement, the podcast dedicated to helping you enhance your skills and knowledge in the world of technology. I’m your host, Victor, and today we are diving into the world of RancherOS, a Linux distribution specifically designed for running Docker containers.
But before we dive in, I want to remind you to subscribe to our podcast wherever you listen to your favorite shows, so you never miss an episode. And if you have any questions or suggestions for future topics, feel free to reach out to us on our website or social media channels. Okay, let’s get started!
Today, we’re focusing on a step-by-step guide for setting up RancherOS on AWS. Now, there is an AMI available in the AWS Marketplace, but there are some additional configurations and security group setups that can be a bit tricky. And that’s where this guide comes in as the missing manual. So, let’s jump right into it.
STEP 1: Launch an Instance with the Rancher AMI. Assuming you already have a .pem
key, go ahead and launch an instance and select the Rancher AMI.
STEP 2: Connect to Your Instance. Open a terminal and connect to your instance using SSH. It’s important to note that you should use the ‘rancher’ user instead of root.
ssh -i "XXX.pem" rancher@ec2-XX-XXX-XX-XX.ap-southeast-1.compute.amazonaws.com
STEP 3: Verify the Rancher Server. Check if the Rancher server is already running by executing the following command:
docker ps
If it’s not running, download and start the server using Docker:
docker run -d -p 8080:8080 rancher/server
STEP 4: Configure Security Groups. Head over to the Security Group tab in the AWS console and create a new security group with the appropriate inbound rules. These rules should include ports for Docker Machine, Rancher network, UI, and the site you deploy.
STEP 5: Assign the New Security Group. Select the instance and navigate to Actions > Networking > Change Security Group. Choose the new Security Group ID and assign it to your instance.
STEP 6: Access the Rancher UI. Open a browser and enter the Public DNS with port 8080, for example: http://ec2-XX-XXX-XX-XX.ap-southeast-1.compute.amazonaws.com:8080
. You should now see the Rancher UI.
STEP 7: Add Host Using AWS Credentials. To add a host with Amazon EC2, you’ll need the Access Key and Secret Key. If you don’t have them, navigate to AWS Console > IAM > Create New Users and download the credentials.csv
file. Attach the required policy to the user by searching for “AmazonEC2FullAccess”.
STEP 8: Enter AWS Credentials in Rancher UI. Return to the Rancher UI and enter the newly generated Access Key and Secret Key from the credentials.csv
file. Fill out the necessary information, and voila! You’ll have your host up and running.
POSTSCRIPT: For those of you looking to manage Docker’s secret API keys, certificate files, and production configuration, you can explore the beta integration of Vault based on your specific needs.
And that’s it for today’s episode of Continuous Improvement. I hope this step-by-step guide helps you navigate the process of setting up RancherOS on AWS. Remember, practice makes perfect, so don’t be afraid to experiment and learn along the way.
Thank you for tuning in! Make sure to join us next time when we explore more exciting topics and dive deeper into the world of technology. Until then, keep improving and keep learning.
This has been Victor, your host of Continuous Improvement, signing off. Stay curious, my friends.