AWS Architect Certification Training (87 Blogs) Become a Certified Professional
AWS Global Infrastructure

Cloud Computing

Topics Covered
  • AWS Architect Certification Training (78 Blogs)
  • AWS Development (7 Blogs)
  • SFDC Administration Foundation (1 Blogs)
  • Salesforce Admin and Dev Foundation (22 Blogs)
SEE MORE

AWS Fargate – A Compute Engine For ECS

Last updated on Sep 03,2024 9.1K Views

7 / 11 Blog from AWS Compute Services

Containerization has transformed cloud architecture over the past few years, allowing businesses to build, deploy & manage applications at a faster rate. And the momentum behind containers certainly is not showing any sign’s of slowing down. There are a plethora of container & container orchestration services that are available today. Most of them, however, still require you to configure and manage clusters of virtual machines for the containers to run. This is where AWS Fargate comes into the picture. Learn more about the Amazon Web Services with the AWS Training.

In this article, we will be learning about AWS Fargate, a serverless computing platform for containers.

 

Need For AWS Fargate

When container services still didn’t exist, users used to launch their applications on virtual machines. In AWS cloud they deployed applications on EC2 instances. They packaged their application with OS into what we call an Amazon Machine Image(AMI) and then run it on AWS EC2 instance.

Then docker introduced containers, and people started deploying their applications on these containers. Containers resemble VM. One major difference is that unlike VM’s, containers share the host system’s kernel with other containers. The diagram below will make it more clear.

containervm - AWS Fargate - Edureka

So, as these containers started becoming more and more popular, people started using them at huge scale. The number of containers in an EC2 instance increased, which in turn increased the number of instances. AWS then launched Amazon Elastic Container Service(ECS).

But what is ECS service? Amazon Elastic Container Service (Amazon ECS) is a highly scalable, high-performance container orchestration service. Amazon ECS reduced some overhead which users had to manage. However, users still had to manage underlying instances that hosted container applications.

This gave AWS an idea to come up with one service that could handle the underlying virtual machines while users can focus on building their application. The said service is AWS Fargate.

AWS Fargate Tutorial | Edureka

This Edureka tutorial on AWS Fargate will help you understand how to run containers on Amazon ECS without having to configure & manage underlying virtual machines.

What is AWS Fargate?

FargateIcon - AWS Fargate - EduerkaAWS Fargate is a compute engine for Amazon Elastic Container Service(ECS) that allows you to run containers without having to provision, configure & scale clusters of VMs that host container applications.

AWS Fargate eliminates the need for users to manage the EC2 instances on their own. In fact, users don’t need to use EC2 instances at all. Fargate itself will act as compute engine. It lets you focus on elements like designing and constructing your application instead of managing the infrastructure that runs them. With Fargate launch type, all you need to do is package your application in containers, specify the memory and CPU requirements, define IAM policies & launch your application.

AWS Fargate also makes it easy to scale your applications. Once you define all your application requirements, AWS Fargate manages all the scaling and infrastructure needed to run your containers in a highly-available manner. It seamlessly integrates with Amazon ECS & EKS, launches and manages your containers for you.

Now how does this entire process of launching containers without having to maintain underlying servers work? 

Want To Be A Certified AWS Architect?

Check out our AWS Certification Training in Top Cities

IndiaOther Countries/Cities
HyderabadAtlanta
BangaloreCanada
ChennaiDubai
MumbaiLondon
PuneUK

Working Of AWS Fargate

Before we see the working of AWS Fargate, let’s take a look at some general terms that you encounter frequently when you are dealing with AWS Fargate.

Container: A Docker container is a standardized unit of software development, containing everything that your software application needs to run code, runtime, system tools, system libraries, etc. These containers are created from a read-only template called a container image.

Container Image: Images are typically built from a docker-file which is a plain text file that specifies all of the components that are included in the container. These images are stored in a registry from which they can be downloaded & run in the container.

containerimager - AWS Fargate - Edureka

Task Definitions: The task definition is a text file, in JSON format, that describes one or more containers that form your application. You can think of it as a blueprint for your application.

Task: A task is the instantiation of a task definition within a cluster. You have the option to specify the number of tasks that will run on your cluster.

Clusters: Cluster is basically the logical grouping of resources that your application needs. If you use Fargate launch type with tasks within clusters then Amazon ECS manages your cluster resources. If you use EC2 launch type, then your clusters will be a group of Amazon EC2 container instances that you manage.

fargatestructure - AWS Fargate - Edureka

Now we are ready to venture ahead. The diagram below gives you a rough idea of how to deploy your application on ECS using AWS Fargate.

fargatewrk - AWS Fargate -Edureka

Let’s try to understand the contents of the above image. First, you need to build a container image that suits your application and then store it on a registry. Then you choose a container orchestration service, either Amazon ECS or Amazon EKS and assign resources to your application. Once you have done that you need to create a cluster to group all those assigned resources. This is when you choose AWS Fargate launch type. Now AWS Fargate will launch & run all your containers. It manages all the underlying infrastructure and clusters for you. It also seamlessly scales your application needs without you having to bother about it. 

Wasn’t that very simple?

Want To Take Your 'Cloud' Knowledge To Next Level?

Now, let’s go ahead and deploy a simple web application on Amazon ECS using AWS Fargaet launch type.

AWS Fargate In Action

Follow below steps to deploy a simple web application on Amazon ECS using AWS Fargate launch type. 

Note: Make sure you are in the AWS Region where AWS Fargate is available (You can choose N.Virginia).

Step1: On Amazon Elastic Container Service console click on ‘Get Started’ option. 

Demo - AWS Fargate - Edureka

You will be taken to a page where it says “Getting Started with Amazon Elastic Container Service (Amazon ECS) using Fargate”

Demo - AWS Fargate - Edureka

Step2: Create a container definition. You can always choose preloaded ones if you have just started using AWS Fargate.

Demo - AWS Fargate - Edureka

Step3: Create a task definition. You can use sample task definition or optionally rename the task definition and edit the resources used by the task (such as the Task memory and Task CPU values) by choosing Edit. 

Demo - AWS Fargate - Edureka

Step4: Configure a service that launches and maintains a specified number of copies of the task definition in your cluster. You can use preloaded service definition or optionally rename the service or review and edit the details by choosing Edit.

Demo - AWS Fargate - Edureka

Step5: As the final step you need to configure the cluster. Name your cluster, and then Amazon ECS take cares of the networking and IAM configuration for you. Then review what you have done till now and click on Create to finish.

Demo - AWS Fargate - Edureka

That’s it! Your simple web application should be up and running. 

Now if your service is a web-based application like the one we just launched, you can view its contents with a web browser.

Step6(Optional): Look for IPv4 Public IP address in the network section of your service & enter that in your web browser. You should see a webpage that displays the web application that you just launched.

Demo - AWS Fargate - Edureka

Now you know how to use AWS Fargate launch type to launch containers on Amazon Elastic Container Service. Go ahead and explore. 

Got a question for us? Please mention it in the comments section of “AWS Fargate” and we will get back to you ASAP.

Upcoming Batches For AWS Certification Training
Course NameDateDetails
AWS Certification Training

Class Starts on 18th November,2024

18th November

MON-FRI (Weekday Batch)
View Details
AWS Certification Training

Class Starts on 30th November,2024

30th November

SAT&SUN (Weekend Batch)
View Details
Comments
1 Comment
  • It was an interesting article. But, I didn’t get how EKS will use Fargate as per your diagram and description. Is Fargate a common mechanism for both EKS and ECS. I think there is no native support between EKS and Fargate. Can you provide more details on this.

Join the discussion

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.

image not found!
image not found!

AWS Fargate – A Compute Engine For ECS

edureka.co