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
2019/5/29 fun-tech 資料
Search
ky0000
May 29, 2019
Technology
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
2019/5/29 fun-tech 資料
ky0000
May 29, 2019
Other Decks in Technology
See All in Technology
SREへの勘違いに気づいた後の話
tomodakengo
0
110
Genieを崇めよ
kameitomohiro
0
160
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
330
What the customer really needed
kawaguti
PRO
3
210
品質と信頼性を地続きにする
grimoh
2
790
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
31
27k
リアーキテクチャ後の障害ゼロを目指したShadow Testingの取り組み
nihonbuson
PRO
1
160
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
3
550
Azure Serverless 2026:Production-ready な AI エージェント基盤 / Azure Serverless 2026: Production-Ready AI Agent Platform
miyake
2
240
おい、エージェントを使って終わらせろ
nwiizo
1
690
Vibe Coding で作ったプロダクトをどう安全に動かすか / How to Safely Run Products Built with Vibe Coding
glidenote
0
170
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
2
550
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
Designing for humans not robots
tammielis
254
26k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Balancing Empowerment & Direction
lara
6
1.3k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Producing Creativity
orderedlist
PRO
348
41k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Transcript
Introduction to Kubernetes OpenStream 戦略技術推進本部 ⽊村 嘉宏 k8s
Agenda • What Docker Can do? • What is Container
Orchestrator. • Components of k8s. • Concepts of k8s. • FROM NOW of k8s. • Conclusion.
What Docker can do? Single Node Application Port Forwarding Environment
Variables Persistent Volume Software Defined Network Create Images
What Docker can not do? Auto Multi-node Application Auto Scaling
Update without downtime. Auto Load Balancing.
Dockerだけで運⽤しま すか?
Container Orchestrator • プロビジョニング • ヘルスチェック • オートヒーリング • オートロールアウト
• オートロールバック • オートスケール
Featured Container Orchestrator k8s / ApacheMesos / DockerSwarm world Powered
by GoogleTrends
Featured Container Orchestrator k8s / ApacheMesos / DockerSwarm Powered by
GoogleTrends Japan
Kubernetes is ... Market Leader of Container Orchestrator.
k8s power word. Cloud Native • Cloud Native = Cloud環境に最適化され
ている • 規約/FWによる予測可能性 • Twelve-Factor App • Portability • DevOps • ContinuousDelivery • MicroService • Scalability • AutoHealing/FailFirst https://pivotal.io/jp/cloud-native
Component of k8s 管理者⽬指す⼈向け
Component of k8s cluster resource map kubectl
Component of k8s client: kubectl kubectl • ユーザーがk8sをコントロールするク ライアント。
Component of k8s master: kube-apiserver kubectl • k8sクラスタの全てをコントロール する管制塔の役割 •
RESTAPI
Component of k8s master: kube-scheduler kubectl • podをどのNodeに配置するか決定し、 bind処理を⾏う。
Component of k8s master: kube-controller-manager kubectl • バックグラウンドでk8sク ラスタの状態を管理する •
例えば • replication controller • endpoints controller • namespace controller • serviceaccounts controller • etc…
Component of k8s master: etcd kubectl • k8sのクラスタ情報をyaml で保持する分散KVSシステ ム
Component of k8s master: cloud-controller-manager kubectl • k8sを各種パブリッククラ ウドと連携させる
Component of k8s worker nodes kubectl • worker。 • podを動かす。
Component of k8s worker nodes: kubelet kubectl PodSpecを元にPodを管理す るエージェント。
Component of k8s worker nodes: kube-proxy kubectl • Kubernetes network
proxy. • service を元にPortやクラスタ ネットワークにおけるIPをコント ロールする。 • Concepts of k8sのServiceと関連 • いくつかの動作⽅式がある • userspace • iptables • ipvs
Component of k8s worker nodes: container runtime kubectl • Kubernetesはあくまでもコンテナ
オーケストレーションツール。 • コンテナのランタイムは別にある • 例 • Docker • rkt • cri-o
Component of k8s Conclusion • k8s利⽤者(Developer)は最 低限知っておけば良い • マスターとノードがある •
kubectlコマンドを叩くとAPIサー バーへhttpsアクセスする • (OpenShiftの場合はkubectlの代 わりにocコマンドがある)
Concepts of k8s
Concepts of k8s k8s Objects • yaml形式で定義され、APIを介してetcdに保存される。 • 特定の要素からなる •
apiVersion • Type • Pod / Service / Ingress / etc… • metadata • オブジェクト名やnamespace、ラベル、アノテーション等の メタデータを管理設定する。 • spec • オブジェクトの仕様を定義する。 • Typeに合わせた項⽬を設定する • status • k8s側で管理される。 • k8s上での状態を保持する。 • kubectl create ‒f </path/to/yamlfile>
Concepts of k8s pod • k8sにおけるデプロイの最⼩単位 • 複数のコンテナの集合 • 設定項⽬
• Dockerfileで設定できるもの • container lifecycle(初期化とか) • 環境変数(シークレット/ConfigMap) • ストレージマウント • ServiceAccountの設定 • healthcheck probe • readinessProbe(コンテナ起動チェック) • livenessProbe(コンテナ死活監視) • etc..
Concepts of k8s Deploy pods • pod をデプロイしたり削除したりする 設定がいくつかある •
Deployment • ReplicaSet • DeploymentConfig • ReplicationController • DaemonSet • StatefulSet • CronJob • Job Note: A Deployment that configures a ReplicaSet is now the recommended way to set up replication.
Concepts of k8s Horizontal Pod Autoscaler • AutoScaleを定義するKubernetesObject • kubeletから収集されているコンテナ使⽤統
計情報をベースにdeployment / ReplicationControllerのレプリカ数を調整す る。 • openshiftではheapster x hawkler の構成で メトリクスを取得している。 https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/
Concepts of k8s ResourceQuota/LimitRange • ResourceQuota • namespace毎に使⽤できるクラスタリソースを 制限できる •
LimitRange • namespace内のpod毎に使⽤できるクラスタリ ソースを制限できる • 起動するpodのyaml全てにresources.limit.xxxの項⽬ を⼊れなければならない。 • ※xxxにはcpuやmemoryなどのQuotaで制限している 項⽬が⼊る。 • Quotaを超えてPodを作成することはできない
Concepts of k8s Storage • コンテナに永続化ボリュームをマウントできる • PersistentVolumeClaim • PersistentVolumeとPodのbindingを定義する
• PersistentVolume • 永続化ボリュームの実態を定義する • 使⽤するバックエンドによって様々な制約がある • StorageClass • PersistentVolumeを⾃動作成する。 • PersistentVolumeClaimに利⽤するStorageClassを設 定する • StorageClassの定義がない(or 指定しない)場合はクラ スタ管理者が⾃前で作成しておく必要がある
Concepts of k8s service • Podとの通信に単⼀のエンドポイントを提供する • LabelSelectorと対象Podにつけたmetadata.labelでグルーピング • いくつかの⽅式がある
• Headless services • podのAレコードを管理するエンドポイントを設定する • ClusterIP • クラスタ内からのみアクセスできるバーチャルIPを設定する • NodePort • ホストのPortを公開ポートに設定する • LoadBalancer • クラウドのロードバランササービスをエンドポイントに設定 する。 • ExternalName(require: kube-dns) ref: https://kubernetes.io/docs/concepts/services-networking/service/
Concepts of k8s Ingress • Ingressの役割 • http/https L7-load balancing
• SSL termination • name-based virtual hosting • 動作のためにIngress Controller が必要 https://kubernetes.io/docs/concepts/services-networking/ingress/ https://kubernetes.io/docs/concepts/services-networking/ingress-controllers
Concepts of k8s NetworkPolicy • アクセス制御の仕組みを提供する • Selectorで反映するPodやFrom、Toを設 定する oc
label pod role=frontend oc label pod role=db
Concepts of k8s RBAC • ServiceAccount • Secretへのアクセス許可情報を持つ • namespaceに紐づく
• ⼈に紐づかない • ClusterRole/Role • 各種 k8s Resource へのアクセス許可情報を持つ • ClusterRoleはCluster内で共通 • ClusterRoleBinding/RoleBinding • ClusterRole/Role と SA/User/Groupとの紐づけ を定義する • RoleBinding は namespaceに 紐づく
system:kube-dns kube-dns system:kube-dns rules: - apiGroups: - "" resources: -
endpoints - services verbs: - list - watch kube-system kube-dns (Static ClusterIP) Concepts of k8s RBAC example: kube-dns
Concepts of k8s CustomResourceDefinition • ユーザー定義のKubernetesAPI拡張 • Operatorでプロパティ的に使われる
Concepts of k8s Dependency Map of Kubernetes Objects Creates References
Resources management Network / exposition Configuration Storage IAM Pod generator
FROM NOW of k8s (for developer)
FROM NOW of k8s Operator • k8sOpsの⼤本命 • ライフサイクル管理をコードで書き出せる •
CRDにOperatorの設定を書く。 • podとして起動する。 • OpenShift4にも⼊ってくる
FROM NOW of k8s knative • 2018年度における流⾏りのビルドツールNo.1? • Serving •
リクエストベースのオートスケーラー • Build • kubernetes上でビルド • Event • イベント駆動なシステムを作る • OpenShift4にも⼊ってくる
FROM NOW of k8s Istio • ServiceMeshの本命 • istioctl inject
~でpodにenvoyコンテナを追加して使 う。サイドカーパターン • Kialiと組み合わせて可視化可能 • Jeagerと組み合わせてTracingも可能 container container envoy
FROM NOW of k8s rook • 今⽉始めに1.0がリリースされたストレージ 管理ツール • stableなストレージは今の所Cephのみ。
• S3互換のminioとか⾊々使える。 • Operatorが準備されているのでデプロイ完 了まで約5分
Conclusion Dockerだけで本番運⽤は⼤変なので オーケストレーターを活⽤すべし オーケストレーターのマーケット リーダーは k8s まだk8s使えないの? Componentsは⼤雑把に⾔って maste と
node と kubectl があるよ k8sを使いこなすためにはその概念 を理解すべし k8sの周辺ツールも進化し続けてい る
Thanks!
Reference Training & Tutorials • https://www.cncf.io/certification/training/ • https://kubernetes.io/ja/docs/tutorials/ • https://www.katacoda.com/search
• https://linuxacademy.com/containers/training • https://www.cncf.io/certification/training/
Reference documents • https://kubernetes.io/ja/docs/concepts/ • https://knative.dev/docs/ • https://12factor.net/ja/ • https://cstoku.dev/posts/2018/k8sdojo-01/
Reference icons • https://github.com/kubernetes/community/tree/master /icons • https://material.io/icons/