Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Monitoring Kubernetes

Shinji Tanaka
December 13, 2014

Monitoring Kubernetes

gcp ja night #29
12 Dec 2014

Shinji Tanaka

December 13, 2014
Tweet

More Decks by Shinji Tanaka

Other Decks in Technology

Transcript

  1. 

  2. kubarnetesඪ४ϞχλϦϯά • heapster + cAdvisor 
 → InfuxDB & Grafana

    
 • Ϋϥελ಺ʹ͋ΔͷͰɺΫϥελΛ མ͢ͱམͪΔ 
  3. Minionͷ౷ܭ৘ใऔಘ • http://#{ipaddr}/stats/ • kubeletͷAPI • ཪͰcAdvisor͕ಈ͘  $  curl

     http://10.240.153.49:10250/stats/  |  jq  'keys'   [      "name",      “spec",    #  εϖοΫ      “stats",  #  ౷ܭ৘ใ  1ඵ͝ͱ  60ඵؒ෼      "subcontainers"   ]
  4. 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ඵ෼)
  5. statsͷத਎ #2  #  curl  http://10.240.153.49:10250/stats/  |  jq   '.stats

     |  .[0]  |  keys'   [      "cpu",      "diskio",      "filesystem",      "memory",      "network",      "timestamp"   ]  
  6. 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
  7. ϞχλϦϯάख๏ • Ϋϥελ্Ͱಈ͍͍ͯΔ΋ͷΛ೺Ѳ • kubecfg list pods • kubecfg get

    pods/#{ID} • Munion্ͷίϯςφͷঢ়ଶऔಘ • /stats/#{ID}/#{container} 
  8. kubecfg list pods • cluster/kubecfg.sh -json list pods  \

    JUFNT< \ JEGDFBFDBGG  IPTULVCFSOFUFTNJOJPODCVPZBOU[PEJBDJOUFSOBM   EFTJSFE4UBUF\ NBOJGFTU\ DPOUBJOFST< \ JNBHFCSFOEBOCVSOTQIQSFEJT  OBNFQIQSFEJT 
  9. 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