6 月 18 日 next - kubernetes のコンテナ技術ですべてをシンプルに
TRANSCRIPT
仮想マシン構築・デプロイのイメージ
• Google がランタイムを提供
• リッチなサービス
• すべて自動
• … コードを追加するだけ
• Basic atom• 好きなSWが載せられる
仮想マシン
アジリティが高くなる
柔軟性が高くなる
アプリの構築・デプロイ
連続体としてコンピュート
プラットフォーム
• Google がランタイムを提供
• リッチなサービス
• すべて自動
• … コードを追加するだけ
● マネージド型の集合体
● 宣言型 + 動的
プラットフォームクラスター
• Basic atom• 好きなSWが載せられる
アジリティが高くなる
柔軟性が高くなる
コンテナの構築・デプロイ仮想マシン構築・デプロイのイメージ アプリの構築・デプロイ
連続体としてコンピュート
仮想マシン
多少のアイソレーション
高価かつ非効率的
ここでもゲストOSに高度に結合している
管理が困難
従来の手法: 仮想マシン
アプリ
ライブラリ
カーネル
ライブラリ
アプリ アプリ
カーネル
アプリ
ライブラリ
ライブラリ
カーネル
カーネル
Google ではすべてがコンテナで実行されている:• Gmail、ウェブ検索、マップ...• MapReduce、バッチ...• GFS、Colossus...• Google Compute Engine の 仮想マシンもコンテナで実行!
なぜコンテナ?• Performance - 性能
• Repeatability - 再現性
• Quality of service - サービスの質
• Visibility - 可視性
Images by Connie Zhou
なぜコンテナ?• Performance - 性能
• Repeatability - 再現性
• Quality of service - サービスの質
• Visibility - 可視性
• Accounting - 課金
Images by Connie Zhou
なぜコンテナ?• Performance - 性能
• Repeatability - 再現性
• Quality of service - サービスの質
• Visibility - 可視性
• Accounting - 課金
• Portability - 移植性
Images by Connie Zhou
なぜコンテナ?• Performance - 性能
• Repeatability - 再現性
• Quality of service - サービスの質
• Visibility - 可視性
• Accounting - 課金
• Portability - 移植性
根本的に異なるアプリケーション管理法
late binding vs. early binding
Images by Connie Zhou
ChallengesWhich host machine should each process run on?
How does the PHP code find the cache process?
How do we keep all of these processes running?
What happens if a host machine has trouble?
Are the processes healthy?
How do we scale when load changes?
Run this in another environment? QA, dev, another cloud, your servers?
“Helmsman(操舵手)”のギリシャ語。“Governor(知事)”の語源でもある。
• コンテナのオーケストレーター• Dockerコンテナを実行• 複数のクラウドおよびベアメタル環境をサ
ポート• Google の経験と内部システムに着想を
得、それに基づいて開発されたもの• オープンソース、Goで書かれている
マシンではなく、アプリケーションを管理
Kubernetes !!!
密結合したコンテナの小
規模な集まり
現在の状態を
望ましい状態へと後押
しするループ
例: replication controller
連動して実行されてい
るポッドのセット
例: 負荷が分散されたバッ
クエンド
コンポーネントを整理す
るための任意のメタ
データ
例: phase=productionrole=frontend
PodReplication Controller Service Label
密結合したコンテナ&ボリュームの小規模
な集まり
• 同一ノード
クラスタ スケジューリング&配置の微小分
子
共有名前空間
• IPアドレス&ローカルホストを共有
エフェーメラル
• 停止、差し替え可能
例: ウェブサーバー
Pod
Pod
静的サイトジェネレータ
ウェブサーバー
ボリューム
ユーザーコンテンツ
マネージャー
ノード1
f0118
ノード3
ノード4ノード2
d9376
b0111
a1209
Replication Controller- Desired = 4- Current = 4
Replication Controller
ノード1
f0118
ノード3
ノード4ノード2
Replication Controller- 望ましい= 4- 現在 = 4
d9376
b0111
a1209
Replication Controller
ノード1
f0118
ノード3
ノード4
Replication Controller- 望ましい = 4- 現在 = 4
b0111
a1209
c9bad
Replication Controller
ノード1
f0118
ノード3
ノード4ノード2
a32bx1 a1209
Replication Controller
b0111
c9bad
Replication Controller- 望ましい = 4- 現在 = 5
ノード1
f0118
ノード3
ノード4ノード2
a32bx1
Replication Controller- 望ましい = 4- 現在 = 4
Replication Controller
b0111
c9bad
1つのものとして振る舞うポッドの集まり == Service
健常なポッド間の負荷を平衡に保つ
安定した仮想IPおよびポートを入手• DNS名も
複雑さを隠す• ネイティブでないアプリに最適
Service
安定したIP / ポート
app: guestbookphase: testrole: frontend
app: guestbookphase: testrole: backend
app: guestbookphase: devrole: frontend
app: guestbookphase: devrole: backend
Labels app: encodingphase: prod
app == guestbook
Labels
app: guestbookphase: testrole: backend
app: guestbookphase: devrole: frontend
app: guestbookphase: devrole: backend
app: encodingphase: prod
app: guestbookphase: testrole: frontend
app == guestbookrole == frontend
Labels
app: guestbookphase: testrole: backend
app: guestbookphase: devrole: frontend
app: guestbookphase: devrole: backend
app: encodingphase: prod
app: guestbookphase: testrole: frontend
Labels
app: guestbookphase: testrole: backend
app: guestbookphase: devrole: frontend
app: guestbookphase: devrole: backend
app: encodingphase: prod
app: guestbookphase: testrole: frontend
app == guestbookrole == backend
phase == dev
Labels
app: guestbookphase: testrole: backend
app: guestbookphase: devrole: frontend
app: guestbookphase: devrole: backend
app: encodingphase: prod
app: guestbookphase: testrole: frontend
phase == test
Labels
app: guestbookphase: testrole: backend
app: guestbookphase: devrole: frontend
app: guestbookphase: devrole: backend
app: encodingphase: prod
app: guestbookphase: testrole: frontend
Google Container Enginehttps://cloud.google.com/container-engine
google-containers google グループ
Kubernetes https://github.com/GoogleCloudPlatform/kubernetes
irc.freenode.net #google-containers
@kubernetesio