25
Cloud Foundry Container-to-Container Networking

Cloud Foundry Container-to-Container Networking

Embed Size (px)

Citation preview

Page 1: Cloud Foundry Container-to-Container Networking

Cloud FoundryContainer-to-Container Networking

Page 2: Cloud Foundry Container-to-Container Networking

Pivotal Japan - Platform Architect

Kazuto Kusama@jacopen

Page 3: Cloud Foundry Container-to-Container Networking

Microserviceしてますか?

FourBlairServicesPvt.Ltd.https://commons.wikimedia.org/wiki/File:Services4.png

Page 4: Cloud Foundry Container-to-Container Networking

機能ごとにソフトウェアを細分化

開発チームも機能単位

Page 5: Cloud Foundry Container-to-Container Networking

いままでのCFだと・・・

appA appB appC appD appA appD

`

Router

DB MQ

Cell Cell Cell

HTTPのエンドポイントがRouter経由になってしまう

Page 6: Cloud Foundry Container-to-Container Networking

コンテナ間で直接通信したい!

appA appB appC appD appA appD

Router

DB MQ

Cell Cell Cell

Page 7: Cloud Foundry Container-to-Container Networking

そこで

Page 8: Cloud Foundry Container-to-Container Networking

Container-to-Container Networking

Page 9: Cloud Foundry Container-to-Container Networking

Container-to-Container Networking• Cloud Foundryでコンテナ間通信を可能にする新機能• 最近GAになりました!• 最新版は1.1.0

• Pivotal Cloud Foundryだと1.11からGAとして提供

Page 10: Cloud Foundry Container-to-Container Networking

利用方法• BOSHでcf-networking-releaseをセットアップ

https://github.com/cloudfoundry-incubator/cf-networking-release• UAAでnetwork.adminのscopeを有効化

• ドキュメントはこちらhttps://docs.cloudfoundry.org/devguide/deploy-apps/cf-networking.html

Page 11: Cloud Foundry Container-to-Container Networking

さっそくDEMO

Page 12: Cloud Foundry Container-to-Container Networking

ざっくりとした仕組みの説明

Page 13: Cloud Foundry Container-to-Container Networking

Architecture

https://github.com/cloudfoundry-incubator/cf-networking-release/blob/develop/docs/diagram.png

青: 元からある仕組み緑: 新しく追加された仕組み赤: 差し替え可能

Page 14: Cloud Foundry Container-to-Container Networking

https://github.com/cloudfoundry-incubator/cf-networking-release/blob/develop/docs/diagram.png

Page 15: Cloud Foundry Container-to-Container Networking

CNI• Container Network Interface• CNCF(Cloud Native Computing Foundation)によって策定されている、コンテナネットワーキングのための仕様• Cloud Foundryの他、KubernetesやMesos、rkt・・・要はDocker以外😛 で使われている

Page 16: Cloud Foundry Container-to-Container Networking

Container Runtime

Container Network Interface

LoopbackPlugin

BridgePlugin

PTPPlugin

MAC VLANPlugin

3rd-partyPlugin

Page 17: Cloud Foundry Container-to-Container Networking

Silk• CNI準拠のContainer Networking fabric• VXLANを使ってホスト間の通信を行う• Flannelにインスパイアされて作られている• 初期はFlannelを利用。etcdが嫌でRDBを使うように

作り直したらしい

Page 18: Cloud Foundry Container-to-Container Networking
Page 19: Cloud Foundry Container-to-Container Networking
Page 20: Cloud Foundry Container-to-Container Networking

Garden-runc

Garden External Networker

CF Wrapper CNI Plugin

Silk CLI Plugin

Linux

コンテナランタイム

Garden External Networker API

CNI API

Legacy NetworkingNetIn(NAT from Host)NetOut(Application Security Group)

Silk daemon

Silk Controller

diego cell

IPAMiptablesnetlinkなどなど設定

Page 21: Cloud Foundry Container-to-Container Networking

Garden-runc

Garden External Networker

CF Wrapper CNI Plugin

Silk CLI Plugin

Linux

コンテナランタイム

Garden External Networker API

CNI API

Legacy NetworkingNetIn(NAT from Host)NetOut(Application Security Group)

Silk daemon

Silk Controller

diego cell

IPAMiptablesnetlinkなどなど設定

Silk controllerがCellにsubnetを

払い出す Wrapper PluginがPort forwardingや

ASGを設定

veth pairの作成etc...

Page 22: Cloud Foundry Container-to-Container Networking

cf allow-accessmyapp backend-app--port7000--protocoltcp

Policyの設定

AgentがPolling

iptablesに反映

Page 23: Cloud Foundry Container-to-Container Networking

ここが足りないC2C Networking• Service Discovery欲しい・・・• 今のところはEurekaやamalgam8を使って実現

Page 24: Cloud Foundry Container-to-Container Networking

Next Steps• App Identity for external services• Bandwidth limiting• logging enhancement• support port ranges

• https://www.pivotaltracker.com/n/projects/1498342

Page 25: Cloud Foundry Container-to-Container Networking

まとめ• CFのC2C Networking機能はMicroservicesやるのに便利• CNIに準拠したSilkを利用。必要に応じて置き換え可能• 足りない機能はあれど、今後いろいろ実装される予定