Converting a AWS Fargate instance to AWS EC2

0

I have an EC2 Server that I am planing to containerize and use with with AWS Fargate.

My question is if I want to stop Fargate and come back to EC2, is there a possibility to de-containerize a Fargate container to be used with a EC2 server?

ses2
質問済み 4年前1142ビュー
1回答
0

Hi,

There's nothing specific with containers you run on Fargate.

At a high-level, as long as you have a container you can just create a task definition (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-task-definition.html), specifying the FARGATE launch type and then either use the run-task API to start the task or create-service to create a service that runs one or more copies of the task. Based on your question, the run-task API is probably what you want to use.

Should you choose to stop using Fargate, you can keep the container and just run it on an EC2 instance instead.

There are a few caveats you should keep in mind:

  • If you treat the containerized server as a stateful container (i.e. you are storing state in the container itself) you will need to change this to store state elsewhere otherwise you will lose the state when you stop the task (the same is true even if you run the container on an EC2 instance unless you take explicit steps to store the state outside of the container).
  • Fargate gives you 10 Gb of Docker layer storage and 4 Gb for volume mounts. If your container image is larger than 10 Gb you won't be able to run it on Fargate (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html)
profile pictureAWS
Mats
回答済み 4年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ