What is AWS Fargate and how to configure Fargate in AWS ?

AWS Fargate is a serverless compute engine for containers that works with Amazon Elastic Container Service and Amazon Elastic Kubernetes Service. Fargate makes it easy for you to focus on building your applications. Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.”

It is a container management service that handled entirely by AWS and just need to define the parameters.

AWS Fargate-

Fargate removes the need to provide and manage the servers, allows you to specify and pay resources by application and improves safety by the isolation of the design by design. The most populor is Container or VM based.

In this demo, we will try to Dockerized (Containerized) process.

What are the Benefits?

  • You just need to deploy the application not infrastructure.
  • Fully Secure
  • Rich integration with other AWS services.
  • Fault tolerant & High Availability
  • Any Container technologies can be use like cri-o, Docker, Pod man

Now let’s start using AWS FARGATE….

How to start using AWS FARGATE

There are few steps you need to follow else things will start breaking and you will not be able to fully use the Fargate service.

There are only 4 concept that you need to understand to start with Fargate.

  • CLUSTER
  • SERVICE
  • TASK
  • CONTAINER

A) What is Cluster?

Cluster, a bunch of anything like here that can be VMs (EC2 instance) or containers, task, task-definition, services, etc.

B) What is Service?

Service looks after the container that are running, keep on checking their health and many other things.

You should insure to add the correct port no according to container (Task) else the health check will fail.

C) What is Task?

In Task we define our container specific configuration.

Like the port no of the container or target port if you’re using the Load Balancer. You should insure port configuration are correct else the health-check will constantly delete and re-create the container which you really do not want.

D) What is Container?

A process/application that we want to run which is encapsulated in the form of container.

Now we can Move Forward with the Creating the Infrastructure.

Steps-1

After Logging into AWS Account Search for——> ECS

Click on it, The First Page you’ll see is this-

As you see no cluster running which we want to create in next step.

There are two methods to create Cluster either Create Cluster or Get Started

In our demo, we will use Get Started methods.

Steps -2

Here in this Page, we are Choosing the our Container we can choose from the predefined or we can create our own customs.

We will choose the Nginx Image…..

You can see below that we define the task, how much RAM, CPU required for the container according to our use case.

After Moving Forward we are configuring the service, like do we need the load-balancer or not , no of container we need.

And give the Name of Cluster…

After Validating all the Configuration, we are ready to launch the AWS Fargate Cluster.

We can check the service which look like this

As we can see that our container is running.

Find the URL Endpoint at the task detail tab

And we can see the public ip that we can use to connect.

Here is the Nginx Default page.

Resource Clean UP

Just Delete the Cluster, it will cleanup all associated resources.

By Clicking on the Delete Cluster Button. Your Cluster and its resources will remove to avoid some cost for you.

About Shachindra Yadav

I, Shachindra Yadav, a Cloud Certified, DevOps and technology enthusiastic person, more passionate to learn and write blogs in my free time.

View all posts by Shachindra Yadav →