AWS/ECS

[AWS ECS] Amazon ECS Basics

brightlightkim 2022. 3. 22. 06:50

What is AWS?

Why AWS ECS?

Before Amazon ECS, companies used to make server on a physical bound >> Server bound >> Problem can occur >> Lot of reasons that it doens't work.

With ECS, it runs simplessly. 

  • ECS Manager Contaniners make the Application can run in a higher available mode

  • Availablity makes users to run 24/7 (high availablity and demand)

What is Amazon ECS?

  • Management Container
    • Placement of containers across your cluster.
  • It adjusts ip or something like that. Nobody changes the parameters. It can run in whatever clouds.
  • From Labtop to Amazon ECS. (Same containers)

What is Docker?

  • High Scalabitily and Efficiency
    • 20 more hosts >> the amount of time is very less 
  • Short boot-up uptime
    • It can run independently.
  • Reusable data volumes
    • We can remap it to the next successive containers (we don't have to build data new)
  • Isolated Applications
    • Isolates one container from the other. (Run on same port or physical machine >> they are well disconnected)

Advantages of Amazon ECS

  • Isolated Applications
    • Container Registry >> images are encrypted >> denied through IAM encryption.
  • Cost Efficient
    • Duel multiple on same nord >> high density on EC2 instance.
    • Launch 10 different containers in one server >> can benefit applications
    • State of the Container
  • Extendable 
    • Problems with environment variation (redeployment) can be solved.
  • Easily Scalable
  • Improved Compatibility

Architecture of Amazon ECS

 

  • ECS Cluster running the ECS Service
  • Container image
    • template of instructions whih is used to create containers
  • Container Registry (Amazon ECR, Docker Hub)
    • Service which is used to host and distribute Docker Images among users
  • VPC (Virtual Private Cloud)

How Amazon ECS work?

 

  • Separate Different Network Interfaces

  • Task has 2 Components
    • ECS container instance
    • Container Agent

Companies using Amazon ECS

  • Okta, Abema TV use it to secure their data.
    • ECS make their difficult and hard work easy. 

 

How to deploy Docker Containers on Amazon ECS?

  1. Create an AWS account
  2. Set up your first run with Amazon ECS
    1. Here, you will launch a wizard using Amazon AWS
  3. Create a Task definition
    1. How many numbers of continers do you need?... etc.
  4. Configure the Amazon ECS service
    1. Configure Service Options
      1. Service Name
      2. Desired number of tasks
      3. Container name
  5. Configure your Cluster
  6. Result: Launch instance & run service

 

Building Process

1. Search ECS Click it.

2. Click Cluster

 

3. Click Create Cluster for Selecting the templates

4. Then you will see the options.

3.1. If you walk from "Get Started" in step 3.. It begins from the scratch.

4. Create Container definition

- Create Basic Image.

- You can also edit it

- Health Check for complex things.

- Environment to make a command. (Basic is Amazon ECS Sample App) >> You can replace it with your own content.

 

5. Create Task definition

 

- Fargate mode means that the server is completely handled by Amazon.

 

6. Click Next

 

- Name of the service and edit is available.

- Edit >> Set the IP Address in the CIDR block section.

Default is no load balancer.

7. Click Next to make name

 

8. Make the Launch (5-10 minutes)

9. You can Access it through Load Balancer and check it in the AWS.

Other Products with Amazon ECS

AMAZON ECR

1. Check with Clicking Amazon ECR

2. Create repository

3. Any image that I create locally can be pushed through these commands. (view Push commands button)

 

How to Access it through the Load Balancer?

1. Goes to EC2 by searching the service

2. View the Load Balancer

 

How to See ECS Clusters?

1. Goes to Amazon ECS and then click clusters and click my cluster

2. You can see the tasks and find the API

- If you click the IP, you can see your own website that is run by this cluster.

3. You can see the logs there too. 

- There is no ECS instance here because this is fargate that doesn't have any ECS instance

 

How to use Load Balancer to find my website?

- Go for the DNS name.

 

'AWS > ECS' 카테고리의 다른 글

[Amazon ECS] Using the awslogs log driver  (0) 2022.05.05
[AWS ECS] How to Create a Security Group?  (0) 2022.03.23
[AWS ECS] How to create a Key Pair in ECS?  (0) 2022.03.23
[AWS ECS] How to Create an IAM user  (0) 2022.03.23
[AWS ECS] Create AWS IAM  (0) 2022.03.22