Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
わたしたちはEKS運用の夢をみるか(vs ECS) / EKS vs ECS Fargate
Search
muryoimpl
September 27, 2019
Programming
350
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
わたしたちはEKS運用の夢をみるか(vs ECS) / EKS vs ECS Fargate
muryoimpl
September 27, 2019
More Decks by muryoimpl
See All by muryoimpl
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
2.6k
人魚とたわむれる
muryoimpl
0
71
Kanzawa.rbのLT大会を支える技術の裏側を変更する Ruby on Rails + Litestream 編
muryoimpl
0
2.4k
Kanazawa.rb LT大会用/kzlt コマンドの説明 2024/01版
muryoimpl
0
3.1k
kzltコマンドの新たなソリューションについて
muryoimpl
0
3.1k
俺とTODOアプリ~Linearの変~
muryoimpl
0
2.9k
POSIX文字クラスでの躓き
muryoimpl
0
2.4k
/kzlt コマンドとは
muryoimpl
0
1.1k
meetup.kzrb.org の更新を考える 事前激闘編
muryoimpl
0
1.7k
Other Decks in Programming
See All in Programming
Workers Cache を知る
syumai
0
350
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
200
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
460
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
550
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
140
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
280
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
170
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
480
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
560
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Tell your own story through comics
letsgokoyo
1
1.1k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
350
Un-Boring Meetings
codingconduct
0
450
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
Evolving SEO for Evolving Search Engines
ryanjones
0
320
Transcript
わたしたちは EKS 運用の夢 をみるか (vs ECS) ESM Real Lounge 2019/09
無量井 健
モチベーション AWS EKS を使おうとした場合、コストが高い、というイメージがありますが、実際どのくら いコストが高いの?というのをECS(Fargate) と価格面、構築面のコストから比較したい な、と思った。 これくらいのコスト(or 増) なら、まぁ今回EKS
使ってみる?となるかどうかをみてみようと いう試み
比較の前提条件 • AWS の ECS (Fargate) と EKS でおおよそ同じようなインフラ、アプリケーションを 構築して比較してみます
• 一部構成が異なる部分がありますのでその差分について目をつむってください • ECR で管理した同一の Docker image を使用するものとします • AWS インフラの構築は CloudFormation(YAML) を使用します ◦ JSON は行数が増えるので避けました • ソースはこちら: https://github.com/muryoimpl/ecs-eks-sample
今回作成した Fargate の構成
今回作成した EKS の構成 ※EKSのコントロールプレーンは 隠蔽されており、コンソールから 見えない ※ControlPlane の部分は無料で、 ワーカーノード分のみインスタンス 代がかかる
構築ソース(YAML)での比較 Fargate (CloudFormation yaml): 1051行 EKS(CloudFormation + kube object の
yaml): 918行(fluentd含む) EKS のほうはログにCloudWatch Logs への集約のために別途 fluentd の container を登録する必要があり一手間かかる。kubernetes用fluentd 用 object はGitHubの fluentd/fluentd-kubernetes-daemonset に用意されているので一から作成する必要は ない。 CloudFormationよりkubernetes object のほうが複雑さがない分わかれば書きやすい
作ってハマったところ • EKS構築時、下記URLの手順でCloudFormationの実行のみAnsibleで実行したた め、API呼び出しとコンソール上のユーザが異なっており、「ワーカーノードをクラスターと結合す るには」の手順でレスポンスが返ってこない事象が発生した。 https://docs.aws.amazon.com/ja_jp/eks/latest/userguide/getting-started-console.html RBACというKubernetesの認証テーブルに登録されるのは クラスターを作成した IAMユーザなので、別の IAMユーザでは認証が通らずアクセスできない。
=> 普通はエラーメッセージが返るがこのときは何も返らなかった • 比較対象のECS FargateのALBとのつなぎこみがうまく行かず …
Fargate と EKS の料金比較 ※ECR, RDS, 通信料について同条件として算出に含めていません。
料金(Fargate) Fargateの料金表: https://aws.amazon.com/jp/fargate/pricing/ 1vCPU 0.05056USD/時 1GiB 0.00553USD/時 Webサーバ1台 t2.medium 相当(2vCPU,4GiB)
を30日間(24時間 * 30日 = 720時間) 使用と考えると… (2 * 0.05056 * 720) + (4 * 0.00553 * 720) = 72.8064 + 15.9264 = 88.7328USD 9月26日 15:17 UTC の 1ドル 107.68円 で計算すると、107.68 * 88.7328 = 9554.7479円 t2.medium 1台で 9555円くらい。Rails 実行を考えると、mirationタスクの実行で更に費用が発生する
料金(EKS) EKSの料金: https://aws.amazon.com/jp/eks/pricing/ EC2の料金: https://aws.amazon.com/jp/ec2/pricing/on-demand/ EKS 利用料が $0.20/時(隠蔽されているクラスタ管理部分のインスタンス代については無料) t2.medium 利用料が
$0.0608/時 t2.medium 相当を30日間(24時間 * 30日 = 720時間) 利用すると考えると… (0.0608 * 720) + (0.20 * 720) = 43.776 + 144 = 187.776 USD 9月26日 15:17 UTC の 1ドル 107.68円 で計算すると、187.776 * 107.68 = 20219.7197円
EKSとFargate の料金比較結果 Fargate: 9554.7479円/30日 EKS: 20219.7197円/30日 料金だけの比較でいくと、EKSをちょっと使ってみようか、とはなりにくそう。 コンテナオーケストレーションツールとして
Kubernetes エコシステムを最大限活用した いという欲求がない限りは Fargate を使うことを優先させることとなりそう。
最後に 設定ファイルについてはあまり大きな行数差はなかった。CloudFormation よりは Kubernetes object のほうがパターンが少ない分書きやすそう。ただし、ECS と比較す るとログ集約分の手間がかかる。 お金の面でいうと ECS
のほうがかなり安いので、新規で作成しはじめるとなるととりあ えず ECS で作成して必要に駆られたときに EKS or 他の Kubernetes 環境に移行す る、というのがよさそう
その他参考リンク集 • CloudFormation の template ◦ https://github.com/awslabs/aws-cloudformation-templates • EKS: AWS
マネジメントコンソール の開始方法 (eks用YAMLテンプレあり) ◦ https://docs.aws.amazon.com/ja_jp/eks/latest/userguide/getting-started-console.html • fulentd/fluentd-kubernetes-daemonset ◦ https://github.com/fluent/fluentd-kubernetes-daemonset