Kubernetesを触ってみた
Upcoming SlideShare
Loading in...5
×
 

Kubernetesを触ってみた

on

  • 0 views

Kuberenetesを触ってみたので、こんな感じでしたよとレポートします

Kuberenetesを触ってみたので、こんな感じでしたよとレポートします

Statistics

Views

Total Views
0
Views on SlideShare
0
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Kubernetesを触ってみた Kubernetesを触ってみた Presentation Transcript

  • Kubernetesを触ってみた 第20回 PaaS勉強会 @jacopen
  • @jacopen Kazuto Kusama NTT Communications ! Cloudn PaaSの開発・運用をやっています
  • Cloud
  • Cloud SaaS PaaS IaaS
  • Cloud SaaS PaaS IaaS
  • Cloud SaaS PaaS IaaS
  • Cloud SaaS PaaS IaaS
  • Cloud = VM?
  • Cloud = VM? うちのサービス、全部コンテナで動いてるで うちもや。VMとか使ってへんで
  • Docker なんか呼んだか?
  • コンテナという選択肢 • コンテナ技術そのものは昔からある • LinuxでもLXCがあった • 商用UNIXの世界ではン十年前からある
  • Dockerのすごいところ どや • コンテナ技術のもつメリットに加えて・・ • 差分ディスクイメージを作ってシェアできる • Dockerfileでインフラのコード化ができる コンテナ技術がグッと身近に。 コミュニティが進化すればするほど使いやすく。
  • 運用に課題 • どうやって数あるホストにコンテナを配置 する? • どうやって今稼働しているコンテナを管理 する? • 死活監視は? Dockerだけでは運用できない
  • Kubernetes
  • Kubernetesとは Googleが公開した、コンテナ管理ツール ! Kubernetes (koo-ber-nay'-tace) is Greek for “helmsman” of a ship. 船の舵を取る人 という意味らしい
  • Design Overview Kubernetes is a system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications https://github.com/GoogleCloudPlatform/kubernetes/blob/master/DESIGN.md
  • まずは触ってみよう
  • DEMO
  • 今回のKubernetes環境 Master Node (Minion) Node (Minion) Node (Minion) Node (Minion)
  • Demoで構築したもの Frontend Replication Controller frontend frontend frontend Redis Slave service Redis master service redisslave redisslave redis-master Redis Slave Replication Controller
  • Kubernetesの仕組み • Pod • Label • Replication Controller • Service
  • Pod • コンテナの集まり • 今回のデモだと1Pod 1Container • Pod内のコンテナは、必ず同一ホストにな る • ストレージとか、IPアドレスを共有しなけ ればいけないコンテナをまとめられる
  • Label • Podに「ラベル」を自由に付けられる • 環境を示すラベル(Production, Development, Staging) • 役割を示すラベル(Frontend, Backend, Worker, Logger) • 1つのPodに複数のラベルが付けられる
  • frontend frontend frontend Pod Label redisslave redisslave redis-master
  • Replication Controllers • Podテンプレートから、指定された数の Replicaを作成する仕組み • Podの監視をしていて、指定された数より 多ければ減らし、少なければ減らす
  • replicas:3 Frontend Replication Controller frontend frontend frontend redisslave redisslave redis-master Redis Slave Replication Controller replicas:2
  • Service • L3のプロキシみたいなもの • 設定したPodにラウンドロビンでアクセス を分配する
  • Frontend Replication Controller frontend frontend frontend Port:10000 Port:10001 Redis Slave service Redis master service Port:6379 Port:6379 Port:6379 redisslave redisslave redis-master Redis Slave Replication Controller
  • Frontend Replication Controller frontend frontend frontend Port:10000 Port:10001 Redis Slave service Redis master service Port:6379 Port:6379 Port:6379 redisslave redisslave redis-master Redis Slave Replication Controller Frontend service
  • 自分でKubernetesを試してみる 今だといろんな環境で試せる • Google Compute Engine • Vagrant • CoreOS • Microsoft Azure • Digital Ocean • OpenStack
  • 環境によって構築方法は異なる • Kubernetesリポジトリの、Getting Started Guidesを参照。 • GCEで構築はめちゃくちゃ楽 • gcloud cliが使える状態なら、構築はコマ ンド一発 • 対応表に入っていないIaaSでも、その上に CoreOSクラスタ構築すれば使えるんじゃ ないかな?
  • Kubernetes=PaaS?
  • 今後調べたいこと • OpenShift+Kubernetes • Corekube(CoreOS+Kuberenetes +OpenStack) • Network周り