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
Yak shaving を避けながら AWS Fargateを使った話 / AWS Farg...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
OPTiM
October 24, 2019
Programming
1.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Yak shaving を避けながら AWS Fargateを使った話 / AWS Fargate without Yak shaving
OPTiM
October 24, 2019
More Decks by OPTiM
See All by OPTiM
Railsバージョンを4倍にした話
optim
0
350
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
300
IHV like なユースケースへのOpenID Connect 関連仕様の適用事例
optim
0
650
製品の問い合わせ負荷をLLMで解消したい 〜RAGで作る「自社を知っている」チャットボット〜
optim
0
46
AI エージェントシステムの開発を AI で加速させたい!
optim
0
47
既存プロダクトのRSpec カバレッジを 40% から100% にした話
optim
1
150
最近やってよかったデザインシステム運用改善3選
optim
1
440
<install>要素は何ができて、何を変えるのか
optim
1
380
CIでリグレッションテストを実行し継続的に品質を担保する
optim
1
410
Other Decks in Programming
See All in Programming
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
4
3.5k
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
200
The Rails Doctrine Decade
koic
2
590
Workers Cache を知る
syumai
0
360
カツオ、ご期待ください
suneo3476
0
190
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.3k
Google's AI Overviews - The New Search
badams
0
1.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
RailsConf 2023
tenderlove
30
1.6k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
370
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Claude Code のすすめ
schroneko
67
230k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
280
Transcript
Copyright © OPTiM Corp. All Right Reserved. Yak shaving を避けながら
AWS Fargateを使った話 Oct 24, 2019 株式会社 オプティム Takahashi
Copyright © OPTiM Corp. All Right Reserved. 2 高橋(Takahashi)
プラットフォーム事業部 DXユニット マネージャー SNS • Twitter:@yukey1031(ukitiyan) • Github:@ukitiyan • SlideShare: @ukitiyan(https://www.slideshare.net/ukitiyan) • Qiita: @ukitiyan(https://qiita.com/ukitiyan) 備考 • 2018/09 OPTiM入社(無事に1年経過!) • 好きなCIOSサービス:Messaging • Javaとサーバーレスを好む • 過去にマギーと呼ばれていた
Copyright © OPTiM Corp. All Right Reserved. 3
Copyright © OPTiM Corp. All Right Reserved. 4
Copyright © OPTiM Corp. All Right Reserved. 5 本題
Copyright © OPTiM Corp. All Right Reserved. 6 お話すること AWS
Fargate AWS CloudFormation
Copyright © OPTiM Corp. All Right Reserved. 7 キーワード ある問題を解決しようとするとそのためにまた別の問題が
発生する、ということが繰り返し起こる現象
Copyright © OPTiM Corp. All Right Reserved. 8 シナリオ(仮定) CIOSを活用しながらも
アプリのみ AWSにデプロイするDX案件 (期間限定だけど今すぐに) というシナリオ
Copyright © OPTiM Corp. All Right Reserved. 9 構成 Cloud
IoT OS ( CIOS ) App App App IdM App Cluster App App Messaging (Pub/Sub) FileStorage Streaming ここだけ AWSに Appは 若いメンバーが実装
Copyright © OPTiM Corp. All Right Reserved. 10 構成 Cloud
IoT OS ( CIOS ) App App App IdM App App Messaging (Pub/Sub) FileStorage Streaming AWSに Appをデプロイ
Copyright © OPTiM Corp. All Right Reserved. 11 Java,
Vue.js, PHP... で実装されたマイクロサービス前提のAppのデプロイに対 応する。 CIOSとの親和性は残したまま、本件に伴うApp カスタマイズは極力行わない。 一時的な公開となるため、極力サーバー運用に手を掛けない。 基本的にこの周辺は自分が行う。 • 若いメンバーはApp実装しながら、私の行動を見つめている。という妄想。。 考える事
Copyright © OPTiM Corp. All Right Reserved. 12 Fargate一択 なのは確か
AWS Fargate
Copyright © OPTiM Corp. All Right Reserved. 13 AWS構成 VPC
Availability Zone Availability Zone Public subnet Bastion Public subnet Private subnet Private subnet DT Web Sub App WebAPI Video Server DT App DB subnet DB subnet Ras Front
Copyright © OPTiM Corp. All Right Reserved. 14 先程の妄想。。
Copyright © OPTiM Corp. All Right Reserved. 15 何食わぬ顔で `シュっ`
とやりたい
Copyright © OPTiM Corp. All Right Reserved. 16 シュっとやる
Copyright © OPTiM Corp. All Right Reserved. 17 CloudFormationで `シュっ`
とやる Not Terraform
Copyright © OPTiM Corp. All Right Reserved. 18 AWS SamplesのCFテンプレートを活用
Amazon ECSおよびAWS CloudFormation(YAML)で コンテナー化されたマイクロサービスをデプロイするための リファレンスアーキテクチャ(Not Fargate)
Copyright © OPTiM Corp. All Right Reserved. 19 Fargateに対応する。
今回App用のServiceとAWSWaf, Bastion, RDS, S3等各種InfrastructureのCFテンプ レートをネストで実装する。 (AutoScalingも必要に応じて設定 BastionのCloud-InitでDDL, DMLの実行をする。 マイクロサービスに対応するために、ECS ServiceDiscovery、TaskRoleへの AWSXRayDaemonWriteAccessと各TaskへのxrayデーモンのサイドカーをCFテンプ レートに実装する。 既存のパイプラインを使いAppのDockerImageは所定のECRにプッシュされる前提。 対応事項 参照:
Copyright © OPTiM Corp. All Right Reserved. 20 aws
cloudformation create-stackコマンドでデプロイ実行。 環境構築 stack起動 20分 シュっと完成!!
Copyright © OPTiM Corp. All Right Reserved. 21 他にやっておくべきこと
Copyright © OPTiM Corp. All Right Reserved. 22 マイクロサービス前提なAppを 連携するための
サービスディスカバリー
Copyright © OPTiM Corp. All Right Reserved. 23 Amazon ECS
Service Discovery https://aws.amazon.com/jp/blogs/news/amazon-ecs-service-discovery/ App Mesh とは 統合しない
Copyright © OPTiM Corp. All Right Reserved. 24 ECS Service
Discovery Amazon Route 53 Hosted zone ECS(ServiceDiscovery) ECSServiceDiscoveryNamespace: Type: AWS::ServiceDiscovery::PrivateDnsNamespace Properties: Vpc: !Ref VPC Name: "showroom.local" Resources: ServiceDiscoveryRecord: Type: "AWS::ServiceDiscovery::Service" Properties: Name: ”dt-app” DnsConfig: NamespaceId: !Ref ECSServiceDiscoveryNamespace Route table showroom.local dt-app.showroom.local PrivateDNSにAレコードが追加され対象サービス に自動紐づけ
Copyright © OPTiM Corp. All Right Reserved. 25 サービス間の連携をトレースする 分散トレーシング
Copyright © OPTiM Corp. All Right Reserved. 26 AWS X-Ray
https://docs.aws.amazon.com/ja_jp/xray/latest/devguide/aws-xray.html App Meshは使わない
Copyright © OPTiM Corp. All Right Reserved. 27 X-Ray AWS
X-Ray Task App x-ray-demon <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-xray-recorder-sdk-spring</artifactId> <version>2.3.0</version> </dependency> @Aspect @Component public class XRayInspector extends AbstractXRayInterceptor { ... } e.g. Spring Appの場合 抜 粋
Copyright © OPTiM Corp. All Right Reserved. 28 マイクロサービス間のメトリクスを 収集、集計、要約
Copyright © OPTiM Corp. All Right Reserved. 29 Amazon ECS
Container Insights 因みに、CF未対応
Copyright © OPTiM Corp. All Right Reserved. 30 Amazon ECS
Container Insights 現在、AWS CloudFormation を使用して新しいクラスターを作成する場合、Container Insights を有効にすることはできません。 深追いせずに、AWS CLI のバージョン 1.16.200 以降で以下2コマンドで有効にする。 $ aws ecs put-account-setting --name "containerInsights" --value "enabled" $ aws ecs update-cluster-settings --cluster showroom ¥ --settings name=containerInsights,value=enabled
Copyright © OPTiM Corp. All Right Reserved. 31 サービス単位での部分リリース
Copyright © OPTiM Corp. All Right Reserved. 32 kayac/ecspresso
Copyright © OPTiM Corp. All Right Reserved. 33 kayac/ecspresso
面白法人カヤックさん から提供されているGo製のECSデプロイツール。 CloudFormationでのサービスのデプロイも可能だが、副次的に他サービス が更新されるリスクがあるため、サービス単体でデプロイ可能は幸せ。 AWS CLIのラッパーのため、CFでサポートされていないAPI(例えば FireLens)等の対応が先行する。 $ ecspresso init --region ap-northeast-1 --cluster rasshowroom ¥ --service webapi-service --config webapi.yaml $ ls ecs-service-def.json ecs-task-def.json webapi.yaml $ ecspresso deploy --config webapi.yaml ・init して deploy するだけでサービスの更新
Copyright © OPTiM Corp. All Right Reserved. 34 まとめ
Copyright © OPTiM Corp. All Right Reserved. 35 本質的に、どうすれば Yak
Shavingを避けられるか?
Copyright © OPTiM Corp. All Right Reserved. 36 ご清聴ありがとうございました!!
Copyright © OPTiM Corp. All Right Reserved. ‹#› © 2019
OPTiM Corp.