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.3k
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.8k
Mackerel's first year and onward (in English)
stanaka
0
360
Blue-Green Deployment with ECS and monitoring
stanaka
0
570
Mackerel Meetup #4 (in Eng)
stanaka
0
480
Mackerel Meetup #4
stanaka
0
3.1k
Other Decks in Technology
See All in Technology
日経ビジュアルデータにおける スクロールテリングと地図/nikkei-tech-talk-26
nikkei_engineer_recruiting
0
160
dbt-coreで実現するCore DataMartsのデータモデリング〜dbt編〜 / Core DataMarts Modeling with dbt-core
i125
3
1.2k
omakaseしないための.rubocop.yml のつくりかた / How to Build Your .rubocop.yml to Avoid Omakase #kaigionrails
linkers_tech
3
210
現実のRuby/Railsアップグレード
takeyuweb
3
3.1k
Jamstack でリニューアルするグリーグループのメディア
gree_tech
PRO
2
220
Hotwire光の道とStimulus
nay3
5
2.2k
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
570
KMPプロジェクトでマニュアルDIを使う選択
rmakiyama
0
120
生成AIの強みと弱みを理解して、生成AIがもたらすパワーをプロダクトの価値へ繋げるために実践したこと / advance-ai-generating
cyberagentdevelopers
PRO
0
120
現地でMeet Upをやる場合の注意点〜反省点を添えて〜
shotashiratori
0
160
EKS初心者が早めに知っておきたかったこと
cuorain
0
140
グローバル展開を見据えたサービスにおける機械翻訳プラクティス / dp-ai-translating
cyberagentdevelopers
PRO
1
110
Featured
See All Featured
BBQ
matthewcrist
85
9.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Six Lessons from altMBA
skipperchong
26
3.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.6k
Agile that works and the tools we love
rasmusluckow
327
21k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Documentation Writing (for coders)
carmenintech
65
4.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
106
49k
Code Reviewing Like a Champion
maltzj
519
39k
Scaling GitHub
holman
458
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ҹ • ͍Ζ͍Ζศརʹ͑ͦ͏Ͱເ͋Δ • ϓϩμΫγϣϯʹಥͬࠐΉͷ·ͩ… • དྷՆ͙Β͍ʹ͜ͳΕ͖ͯͦ͏?