08 - Going cloud - Deploying Docker Applications on AWS Beanstalk

we're going to explore hosting Docker instances on AWS Elastic Beanstalk.
  Create a new Docker application on AWS Elastic Beanstalk 
Let's first go to Elastic Beanstalk. Let's make sure that we're in the right geographic region. North Virginia is where I would like to be well not exactly North Virginia but that's where I would like my Amazon server to be.
 
Click on "Create New Application" and let's give our application a name, CA Web Server. We could include a description but we won't right now just for demonstration purposes. Click on "Next." Now we have to select a tier that is what type of service do we want our instance to provide. We're aiming to be a web server so we'll choose web server. Select the platform and here is the key.
 
We are looking for a Docker instance, a Docker container as our platform. We now have two choices in environment type a single instance or load balancing auto scaling. We'll choose single instance. Click "Next" and we will upload our own file. We're going to upload a Docker file that we've worked with in the past just to see how well it works in this environment. Click on "Next" again and let's check the availability of this name because of course this name will be part of a URL accessible from anywhere in the internet and it has to be unique.
 
Click on "Next" again. We don't need additional resources but you could choose RDSDB and also to run this environment within a VPC. Instance type we'll choose the default t1.micro but you can use any instance. In fact, this process will create the Docker container as an EC2 instance the type that you're probably familiar with already from AWS. Select a key pair. We'll go with the key pair that already exists that's associated with my account. We could enter an email address and Amazon would send us alerts when there are any important events associated with this account. We're not going to right now. I'm going to click on "Next."
 
We could also add new environment tags for added security. That you would have a key and a value. The key could be any characters numeric or alphabetic or any other characters on the keyboard. And the value also could have any characters. The combination of the two will allow for much more secure connections but we don't need that right now. Click on "Next" again and review the service the way we have it configured.
 
Everything looks fine. Click on "Launch."
  Monitor your Docker containers on AWS 
This window will update as the configuration and loading of the container proceeds and any events will be shown to us on this window. Beyond that we can also look through, you can click on "Configuration" for a review of the configuration that we've given this container. Logs will allow us access to many or just a few of the logged events associated with this container.
 
Monitoring allows us eventually once the environment is actually up and running to monitor the conditions associated with this container. Alarms you can guess we can set and define any email alerts that should be tripped or triggered by selected events. Events is a review of all that's happened associated with this container until this point. Let's go back to the dashboard and then click through to EC2 to see how Amazon is displaying our instance.
 
We'll click on "Instances" and this one CA Web Server is the instance we've just created. It is apparently already running and it's public DNS is this one here. We can copy it and use it from a terminal on any computer anywhere in the world to access our instance. Now we can actually log into our Docker container that's being hosted on Amazon's Elastic Beanstalk using SSH-I which will point to a mykey.pem which is the key pair that we chose to use. We'll log in as EC2-user. Not the Ubuntu user which is usually the default for an LXE for using Ubuntu as its base but EC2-user.
 
By the way, we're not logging on as root the way one would automatically with a locally hosted Docker instance. The address is the address we saw given in the EC2 dashboard. Let's see what happens when we log in. We say, "Yes," because we want to accept this key and we're in.

Comments

Popular posts from this blog

Cloud Computing in simple

How to Write an Effective Design Document

Bookmark