lattice深掘り話
TRANSCRIPT
Latticeとは• コンテナ管理システム
• スケジューリング • 動的ルーティング • 死活監視 • ログ収集
• Docker image互換
• 次期Cloud Foundry(Diego)のサブセット
Cell
Cell
Cell
app A
app A
app B
End User
Router
appA.example.com
appB.example.com
Dynamic routing
Kubernetesの特徴• Dockerコンテナをマルチホストで管理する仕組み
• コンテナを使いやすくする仕組みが充実
• Pod • Service • Replication Controller
• 使いこなすには、これら独自概念の理解が必要
Kubernetesの特徴• Dockerコンテナをマルチホストで管理する仕組み
• コンテナを使いやすくする仕組みが充実
• Pod • Service • Replication Controller
• 使いこなすには、これら独自概念の理解が必要
• ロゴが青い
Latticeの特徴• Webアプリを動かすコンテナをマルチホストで管理する仕組み
• Docker imageにも対応(後で説明)
• コンテナへのアクセスはHTTPのみ • 独自概念の理解はあまり必要が無い
Latticeの特徴• Webアプリを動かすコンテナをマルチホストで管理する仕組み
• Docker imageにも対応(後で説明)
• コンテナへのアクセスはHTTPのみ • 独自概念の理解はあまり必要が無い • ロゴが緑
Cellの中身
Cell
rep
exector
garden
garden-backend
Container Container Container Container Container Container
Container Container Container Container Container Container
Container Container
Container Container
Cellの中身
Cell
rep
exector
garden
garden-backend
Container Container Container Container Container Container
Container Container Container Container Container Container
Container Container
Container Container
rep コンテナを動かすためのオークションに参加exector repからのコンテナ起動/削除指示を受け取る
garden-backend コンテナを動かす仕組み
exector
garden-linux
Container Container Container Container
Container Container Container Container
exector
garden-windows
Container Container Container Container
Container Container Container Container
exector
garden-xxxx
Container Container Container Container
Container Container Container Container
exector-garden間はインターフェースが定められており、 それを満たしていればバックエンドはさまざまな実装が可能。Lattice標準ではgarden-linux
Garden
• Gardenは、Pluggableなコンテナのバックエンドを実現する仕組み
• Garden-backendはGardenインターフェースを備えたバックエンド
• Lattice標準のGarden-backendであるGarden-linuxは、Docker imageを利用することが出来る
• よってLatticeは、標準でDocker image互換となる
将来的には、libcontainerを使ってよりDockerに近い環境を実現するbackendや、Windowsコンテナのbackend、rktのbackendなどが出るかもしれない
• 元々Cloud FoundryはWardenという独自のコンテナでアプリを動かしていた
• Garden-linuxはWardenのGolang実装
• Garden-linuxでは次期Cloud Foundryでも利用するため、互換性を担保する必要がある
Cell
Cell
Cell
app A
app A
app B
End User
gorouter
appA.example.com
appB.example.com
Dynamic routing
Cell
Cell
Cell
app A
app A
app B
gorouter
appA.example.com
appB.example.com
実現するには、gorouterがアプリのルート一覧を持っていないといけない
Cell
Cell
Cell
app A
app A
app B
gorouterはNATS経由でroute情報を取得
Route Emitter
NATS
gorouter
gorouter
gorouter
• gorouterは元々Cloud Foundry向けに作られたもの
• Cloud FoundryはNATS経由で疎結合に結びつくアーキテクチャ
• よってgorouterへはNATS経由で情報を送る必要がある
• 将来的にはこのあたりを解消する予定もあるらしい(vulcandみたいな仕組みになる?)
brain
Cellまあ、いっぱいあります
Rep
executor
warden linux
Cell
Rep
executor
warden linuxgorouter
route-emitter
doppler
traffic controller
metron
gnatsd
etcd consul
auctioneer
converger
auctioneer
converger
Cell
Rep
executor
warden linux
Cell
auctioneer
converger
rep コンテナを動かすためのオークションに参加 オークション情報はetcd
auctioneer 動かす必要のあるコンテナをオークションにかける
converger 動作中のコンテナが
正しい数存在するかチェック
Cell
Rep
executor
warden linux
Cell
auctioneer
convergerdoppler ログやメトリクスを集約metron
ログやメトリクスを収集するエージェント
brain
doppler
traffic controller
metron
metron
traffic controller WebSocketでユーザーにログを ストリーミング
Cell
Cell
brainauctioneer
converger
auctioneer
converger
route-emitter
brain
route-emitter
複数同時に動いては困るコンポーネントのロック
brain
Cell結構複雑
Rep
executor
warden linux
Cell
Rep
executor
warden linuxgorouter
route-emitter
doppler
traffic controller
metron
gnatsd
etcd consul
auctioneer
converger
auctioneer
converger
参考情報• Lattice http://lattice.cf/ • Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門 http://www.slideshare.net/jacopen/diego-
45603123 • Diego Design Notes https://github.com/cloudfoundry-incubator/diego-design-notes