Amazon Fargate

Neil Haddley • September 20, 2021

Pay-as-you-go

AWSDevOpsfargateserverless-containersecs

I used AWS Fargate, a serverless pay-as-you-go compute engine, to run containers on Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS).

I used Amazon Elastic Kubernetes Service (Amazon EKS) to deploy, manage, and scale containerized applications using Kubernetes on AWS.

Amazon also offers Amazon Elastic Container Service (Amazon ECS) and Amazon Fargate.

Since Amazon EKS is based on the open-source tool Kubernetes, all applications managed by Amazon EKS are fully compatible with applications managed by any standard Kubernetes environment.

I logged in to aws.amazon.comTap the image to open it full size

I logged in to aws.amazon.com

I navigated to the AWS Management ConsoleTap the image to open it full size

I navigated to the AWS Management Console

Docker desktop

To demonstrate that I could use the same kubectl client to deploy containers to a laptop or the AWS cloud, I used this Docker Desktop example.

No containers were runningTap the image to open it full size

No containers were running

I ran kubectl apply -f ./blog.yamlTap the image to open it full size

I ran kubectl apply -f ./blog.yaml

The cluster was runningTap the image to open it full size

The cluster was running

I accessed the Docker Desktop clusterTap the image to open it full size

I accessed the Docker Desktop cluster

aws cli

I used the aws command line tool to manage the Amazon Web Services cloud.

I created a new AWS access keyTap the image to open it full size

I created a new AWS access key

The access key was createdTap the image to open it full size

The access key was created

aws configure

I used aws configure to set credentials.

BASH
1% aws configure

AWS Access Key ID [None]: AKIAYLZDACM7MNDENQV4

AWS Secret Access Key [None]: iBXYnPPUTp+enyaVU2xvXXXXXXXXXXXXXXXXXXXX

Default region name [None]:

Default output format [None]:

eksctl

I used eksctl, a simple CLI tool for creating clusters on EKS — Amazon's managed Kubernetes service for EC2.

https://github.com/weaveworks/eksctl

I reviewed the eksctl documentation on the AWS siteTap the image to open it full size

I reviewed the eksctl documentation on the AWS site

I found the eksctl project on GitHubTap the image to open it full size

I found the eksctl project on GitHub

I installed eksctlTap the image to open it full size

I installed eksctl

No clusters were runningTap the image to open it full size

No clusters were running

eksctl create cluster

BASH
1% eksctl create cluster \
2  --name blog-cluster \
3  --node-type t2.nano \
4  --nodes 2
I used eksctl to create a cluster (node type t2.nano)Tap the image to open it full size

I used eksctl to create a cluster (node type t2.nano)

The blog-cluster was being createdTap the image to open it full size

The blog-cluster was being created

The blog-cluster was activeTap the image to open it full size

The blog-cluster was active

The blog-cluster EC2 nodes were createdTap the image to open it full size

The blog-cluster EC2 nodes were created

The eksctl command finishedTap the image to open it full size

The eksctl command finished

kubectl apply

I used kubectl apply to deploy containersTap the image to open it full size

I used kubectl apply to deploy containers

eksctl delete cluster

I used eksctl delete to remove the cluster.

BASH
1% eksctl delete cluster \
2  --name blog-cluster
I ran eksctl delete clusterTap the image to open it full size

I ran eksctl delete cluster

The cluster was deletedTap the image to open it full size

The cluster was deleted

Deleting an AWS Access Key

Publishing AWS access keys is not a great idea, so I deleted mine.

I selected the Delete linkTap the image to open it full size

I selected the Delete link

I clicked the Deactivate buttonTap the image to open it full size

I clicked the Deactivate button

I confirmed the access key name and clicked DeleteTap the image to open it full size

I confirmed the access key name and clicked Delete

The access key was deletedTap the image to open it full size

The access key was deleted