Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kubernetes コマンド入門
Search
Kyohei Mizumoto
February 08, 2019
Technology
0
34
Kubernetes コマンド入門
Kyohei Mizumoto
February 08, 2019
Tweet
Share
More Decks by Kyohei Mizumoto
See All by Kyohei Mizumoto
クラウドネイティブ環境の脅威モデリング
kyohmizu
2
520
コンテナサプライチェーンセキュリティ
kyohmizu
2
260
サイバーセキュリティの最新動向:脅威と対策
kyohmizu
1
300
コンテナセキュリティの基本と脅威への対策
kyohmizu
4
1.7k
安全な Kubernetes 環境を目指して
kyohmizu
4
1.2k
Unlocking Cloud Native Security
kyohmizu
5
1.4k
コンテナ × セキュリティ × AWS
kyohmizu
11
4k
コンテナセキュリティ
kyohmizu
10
4.2k
コンテナイメージのマルウェア検出とその実用性について
kyohmizu
4
3.9k
Other Decks in Technology
See All in Technology
ドメイン特化なCLIPモデルとデータセットの紹介
tattaka
2
540
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
130
AI専用のリンターを作る #yumemi_patch
bengo4com
5
2.4k
あなたの声を届けよう! 女性エンジニア登壇の意義とアウトプット実践ガイド #wttjp / Call for Your Voice
kondoyuko
4
530
OpenHands🤲にContributeしてみた
kotauchisunsun
1
500
AWS Organizations 新機能!マルチパーティ承認の紹介
yhana
1
230
5min GuardDuty Extended Threat Detection EKS
takakuni
0
180
生まれ変わった AWS Security Hub (Preview) を紹介 #reInforce_osaka / reInforce New Security Hub
masahirokawahara
0
380
Flutter向けPDFビューア、pdfrxのpdfium WASM対応について
espresso3389
0
110
モバイル界のMCPを考える
naoto33
0
380
SmartNewsにおける 1000+ノード規模 K8s基盤 でのコスト最適化 – Spot・Gravitonの大規模導入への挑戦
vsanna2
0
100
事業成長の裏側:エンジニア組織と開発生産性の進化 / 20250703 Rinto Ikenoue
shift_evolve
PRO
2
9.4k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
A better future with KSS
kneath
239
17k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The World Runs on Bad Software
bkeepers
PRO
69
11k
Building Adaptive Systems
keathley
43
2.6k
Balancing Empowerment & Direction
lara
1
400
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Transcript
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 1/26 Kubernetes コマンド⼊⾨ 1 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 2/26 Kyohei Mizumoto(@kyohmizu) C# Software Engineer
Interests Docker/Kubernetes Go Security whoami 2 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 3/26 対象者 Kubernetes未経験者 3 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 4/26 kubectl 4 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 5/26 kubectl︖ Kubernetesのコマンドを実⾏するCLIツール 5 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 6/26 シンタックス kubectl [command] [TYPE] [NAME]
[flags] 使い⽅がわからないものは --help で確認 6 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 7/26 kubectlコマンド apply config create delete
describe 7 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 8/26 kubectlコマンド exec get logs patch
replace 8 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 9/26 kubectlコマンド scale top version etc...
9 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 10/26 バージョン確認 $ kubectl version 10
/ 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 11/26 リソース作成 $ kubectl create -f
[リソース定義ファイル] 例 $ kubectl create -f sample.yaml 11 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 12/26 リソース差し替え $ kubectl replace -f
[リソース定義ファイル] 12 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 13/26 リソース更新 $ kubectl patch [リソースの種類]/[リソース名]
\ -p [更新後内容] 例 $ kubectl patch pod sample-pod -p \ '{"spec":{"containers":[{"name":"sample","image":"new image"}]}}' 13 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 14/26 リソース定義を適⽤ $ kubectl apply -f
[リソース定義ファイル] create, replace, patchを合わせたような機能 14 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 15/26 リソース削除 $ kubectl delete -f
[リソース定義ファイル] リソース名を指定した削除は⾏わない 15 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 16/26 リソース⼀覧を表⽰ $ kubectl get [リソースの種類]
リソース名指定で個別表⽰ -o wide で追加情報を表⽰ 例 $ kubectl get po,rs,deploy 16 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 17/26 コンテナ上でコマンドを実⾏ $ kubectl exec -it
[Pod名] [コマンド] 例 $ kubectl exec -it [Pod名] /bin/bash 17 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 18/26 ログの確認 $ kubectl logs [Pod名]
18 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 19/26 リソース消費量確認 $ kubectl top [pod
| node] 19 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 20/26 サイズを変更 $ kubectl scale --replicas=n
[リソースの種類]/[リソース名] スケールアウト、スケールイン 通常はマニフェストの修正を⾏う 例 $ kubectl scale --replicas=5 deploy/sample-deploy 20 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 21/26 リソース詳細を表⽰ $ kubectl describe [リソースの種類]
[リソース名] 状態、イベント、リビジョン等の確認 例 $ kubectl describe rs sample-rs 21 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 22/26 設定の変更 $ kubectl config [サブコマンド]
kubeconfigファイルを修正 22 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 23/26 デモ 23 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 24/26 参考書籍 24 / 26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 25/26 参考サイト 公式 https://kubernetes.io/docs/reference/kubectl/ 25 /
26
2019/3/28 Kubernetes コマンド⼊⾨ 127.0.0.1:5500/#26 26/26 Thank you! 26 / 26