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
480
Mackerel Meetup #4
stanaka
0
3.1k
Other Decks in Technology
See All in Technology
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
5
590
Terraform Stacks入門 #HashiTalks
msato
0
350
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
960
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
200
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.3k
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
520
39k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
A better future with KSS
kneath
238
17k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
4 Signs Your Business is Dying
shpigford
180
21k
Unsuck your backbone
ammeep
668
57k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
How GitHub (no longer) Works
holman
310
140k
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ҹ • ͍Ζ͍Ζศརʹ͑ͦ͏Ͱເ͋Δ • ϓϩμΫγϣϯʹಥͬࠐΉͷ·ͩ… • དྷՆ͙Β͍ʹ͜ͳΕ͖ͯͦ͏?