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
オリジナルのKubectlを作る
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
katsunori nakajima
June 25, 2021
Business
0
420
オリジナルのKubectlを作る
katsunori nakajima
June 25, 2021
Tweet
Share
More Decks by katsunori nakajima
See All by katsunori nakajima
Kubernetesクラスタを組む
karosuwindam
0
420
Other Decks in Business
See All in Business
Rakus Career Introduction
rakus_career
0
490k
Hubになる開発者が、組織を強くする ― DevRelから見た、Hubになる開発者の価値 ―
natty_natty254
0
860
イークラウド会社紹介
ecrowdinc
0
360
Atrae, Inc. |Company Profile (EN)
atrae
0
150
Claude Coworkで 非エンジニアも業務効率化しよう
suzakiyoshito
0
1.9k
NEW POP-UP STORE DESIGN/JAPAN SHOP 2026
superpenguin
PRO
0
230
Webinar 04.03.2026 Nuevo marco de contratación, suministro y atención a la clientela en el sector eléctrico
neuroenergia
PRO
0
290
TECTURE 採用資料 / We are hiring
tecture
1
6.4k
The 5 Breaking Points of Engineering Scale
mpandit
1
140
HENNGE会社紹介資料/company_introduction
hennge
4
240k
ADX Company Profile
sanu
0
220
2025年度ICT職専門研修(海外派遣研修)報告書 No.5
tokyo_metropolitan_gov_digital_hr
0
150
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
240
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
For a Future-Friendly Web
brad_frost
183
10k
What does AI have to do with Human Rights?
axbom
PRO
1
2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
490
Mobile First: as difficult as doing things right
swwweet
225
10k
Evolving SEO for Evolving Search Engines
ryanjones
0
160
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
120
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
830
Design in an AI World
tapps
0
170
Transcript
オリジナルのKubectlを作 る 2021/06/25
Kubectlとは • Kuberentesの制御のCUIツール • DeploymentやServiceなどのリソース情報を制御できる • ~/.kube/configに書かれた情報(kubeconfig)をもとに Kubernetesネットワークにアクセスする
Kubectl get pod –A kubectl –n namespace describe pod kubectl
get service –A kubectl –n namespace describe service
PodとServiceを調べたりすることを ワンラインでできないのか?
Client-goというgo言語のライブラリがあ る
Client-goとは • KubernetesのAPIをたたくGo言語のライブラリ • これを使用すれば、Kubernetesの制御をプログラミングできる
使用するには • Go言語 v1.16以上のインストール • Kubernetes環境 • Kubeconfig(ローカルテスト用) • VS
Code(開発環境)
Go言語の使い方 • Go言語をv1.14からv1.16にアップデートで苦労したので • modファイルを作らないとbuildができない • go init mod 適当な名前
• 使用するpackageはmodに書かれていないとエラー • go get パッケージ • 「./フォルダ」で呼び出していたローカルライブラリの書き方 は、「モジュール名/フォルダ」で呼び出すことが可能
• 300行ぐらいで、以下のようなアプリができた。
まとめなど • Client-goを使用して、pod名とネームスペース、それに紐づい たserviceやポートを取得するアプリができた。 • コンテナ化して、podの情報監視も可能
Client-goを使用して Kubernetesクラスタを制御す るアプリを作ろう