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
Monitoring Kubernetes
Search
Shinji Tanaka
December 13, 2014
Technology
1
6.4k
Monitoring Kubernetes
gcp ja night #29
12 Dec 2014
Shinji Tanaka
December 13, 2014
Tweet
Share
More Decks by Shinji Tanaka
See All by Shinji Tanaka
Mackerel loves Machine Learnings
stanaka
0
2.9k
How to Contribute Go
stanaka
4
18k
Introduction to Mackerel
stanaka
0
1k
Upcoming features in 2016, Mackerel
stanaka
0
3.3k
Mackerel's first year and onward
stanaka
0
2.9k
Mackerel's first year and onward (in English)
stanaka
0
370
Blue-Green Deployment with ECS and monitoring
stanaka
0
580
Mackerel Meetup #4 (in Eng)
stanaka
0
490
Mackerel Meetup #4
stanaka
0
3.1k
Other Decks in Technology
See All in Technology
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
OpenShift Virtualizationのネットワーク構成を真剣に考えてみた/OpenShift Virtualization's Network Configuration
tnk4on
0
130
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
180
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
C++26 エラー性動作
faithandbrave
2
700
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
370
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
170
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
Featured
See All Featured
A better future with KSS
kneath
238
17k
The Cult of Friendly URLs
andyhume
78
6.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Code Reviewing Like a Champion
maltzj
520
39k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Transcript
Monitoring Kubernetes gcp ja night #29 Hatena Co., Ltd. @stanaka
! 2014/12/12
[PR] Mackerel https://mackerel.io/
Kubernetes • Docker ΛΫϥελཧ! • ͍Ζ͍ΖͳڥͰಈ͔͍ͨ͠ • MackerelͰϦιʔεཧ͍ͨ͠
Kubernetes Monitoring ʹؔ࿈͢Δཁૉ • kubelet • cAdvisor • heapster
kubelet • ֤ϊʔυ(minion)Ͱಈ࡞ • kubernetes masterͱڠௐಈ࡞
cAdvisor • Dockerͷ౷ܭใΛऔಘ • ϗετશମͱίϯςφຖ • DockerҎ֎ͷίϯςφରԠ HPPHMFDBEWJTPS
heapster • Ϧιʔεใऩूπʔϧ • kubarnetesઐ༻ • InfluxDBΠϯϙʔτ (PPHMF$MPVE1MBUGPSNIFBQTUFS
kubarnetesඪ४ϞχλϦϯά
kubarnetesඪ४ϞχλϦϯά • heapster + cAdvisor → InfuxDB & Grafana
• Ϋϥελʹ͋ΔͷͰɺΫϥελΛ མ͢ͱམͪΔ
Minionͷ౷ܭใऔಘ • http://#{ipaddr}/stats/ • kubeletͷAPI • ཪͰcAdvisor͕ಈ͘ $ curl
http://10.240.153.49:10250/stats/ | jq 'keys' [ "name", “spec", # εϖοΫ “stats", # ౷ܭใ 1ඵ͝ͱ 60ඵؒ "subcontainers" ]
statsͷத $ curl http://10.240.56.195:10250/stats/90559c9f-‐8123-‐11e4-‐ a0ec-‐42010af08f91/php-‐redis | jq ".stats |
.[] | .timestamp" "2014-‐12-‐12T02:41:55.52640117Z" "2014-‐12-‐12T02:41:56.526265405Z" "2014-‐12-‐12T02:41:57.52632129Z" "2014-‐12-‐12T02:41:58.526385146Z" "2014-‐12-‐12T02:41:59.526285874Z" "2014-‐12-‐12T02:42:00.526267704Z" "2014-‐12-‐12T02:42:01.526227391Z" "2014-‐12-‐12T02:42:02.526312936Z" "2014-‐12-‐12T02:42:03.526225182Z" “2014-‐12-‐12T02:42:04.526287033Z" … (ҎԼɺ60ඵ)
statsͷத #2 # curl http://10.240.153.49:10250/stats/ | jq '.stats
| .[0] | keys' [ "cpu", "diskio", "filesystem", "memory", "network", "timestamp" ]
statsͷதৄࡉ UJNFTUBNQ DQV NFNPSZ OFUXPSL \SY UY^@\CZUFT QBDLFUT FSSPST
ESPQQFE^ pMFTZTUFN EFWJDF<> DBQBDJUZ VTBHF JP@UJNF EJTLJP JP@NFSHFE JP@RVFVFE JP@TFSWJDF@CZUFT NBKPS NJOPS TUBUT "TZOD 3FBE 4ZOD 5PUBM 8SJUF JP@TFSWJDF@UJNF JP@TFSWJDFE JP@UJNF JP@XBJU@UJNF TFDUPST
ϞχλϦϯάख๏ • Ϋϥελ্Ͱಈ͍͍ͯΔͷΛѲ • kubecfg list pods • kubecfg get
pods/#{ID} • Munion্ͷίϯςφͷঢ়ଶऔಘ • /stats/#{ID}/#{container}
kubecfg list pods • cluster/kubecfg.sh -json list pods \
JUFNT< \ JEGDFBFDBGG IPTULVCFSOFUFTNJOJPODCVPZBOU[PEJBDJOUFSOBM EFTJSFE4UBUF\ NBOJGFTU\ DPOUBJOFST< \ JNBHFCSFOEBOCVSOTQIQSFEJT OBNFQIQSFEJT
kubecfg get pods • cluster/kubecfg.sh -json get pods/ 73f777c6-8123-11e4-a0ec-42010af08f91 •
Ϩεϙϯε list pods ͱಉ͡
Munion্ͷίϯςφͷঢ়ଶऔಘ • curl http://10.240.56.195:10250/ stats/90559c9f-8123-11e4- a0ec-42010af08f91/php-redis | jq ".stats |
.[] | .timestamp” • Ϩεϙϯε/stats/ͱಉ͡
Φʔτεέʔϧ͍ͤͨ͞ • Ϧιʔεใऔಘ • αΠζมߋஅ • αΠζมߋ࣮ߦ(ඞཁ͕͋Ε)
podsͷಈతͳαΠζมߋ • resizeͰมߋ cluster/kubecfg.sh resize frontendController 4 $ cluster/kubecfg.sh
list replicationControllers Name Image(s) Selector Replicas -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ frontendController brendanburns/php-‐redis name=frontend 4
Kubenetesҹ • ͍Ζ͍Ζศརʹ͑ͦ͏Ͱເ͋Δ • ϓϩμΫγϣϯʹಥͬࠐΉͷ·ͩ… • དྷՆ͙Β͍ʹ͜ͳΕ͖ͯͦ͏?