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

Kubernetesとツール開発 / #chibadan

Kodai Sakabe
October 25, 2016

Kubernetesとツール開発 / #chibadan

全社で Kubernetes を利用していくための取り組みと Kubernetes の便利な機能について話をしました

Kodai Sakabe

October 25, 2016
Tweet

More Decks by Kodai Sakabe

Other Decks in Technology

Transcript

  1. ABOUT ME — Software Engineer — 2010/4- TIS ࡔ෦ ޿େ

    (KOUDAI SAKABE) 2015/8- Wantedly @koudaiii Site: http://koudaiii.com
  2. ͜Ε·ͰͷऔΓ૊Έ w %PDLFSɺ"84ɺ%/4JNQMFΛૢ࡞Ͱ͖ΔXBOUFEMZDBQ w $* XFSDLFS ͷ݁ՌΛऔಘͰ͖ΔXLXL w %#ͷ4DIFNF͔Β(Pͷ"1*Λੜ੒Ͱ͖ΔXBOUFEMZBQJHXBOUFEMZQRHPSN w

    "1*ʹೝূ΍εϩοτϧͳͲΛϒϥ΢βͰઃఆͰ͖ΔXBOUFEMZLPOHGSPOUFOE w αʔϏεʹඞཁͳTZTUFNEͷTFSWJDFΛొ࿥Ͱ͖ΔDFMM w "84%/4JNQMF%BUB%PHΛૢ࡞Ͱ͖ΔEUBOUFSSBGPSNJOHXBOUFEMZUFSSBGPSN w ϑΝΠϧΛؾܰʹڞ༗Ͱ͖ΔEUBOTVSM w &$ͷNFUBUBHΛऔಘͨ͠Γૢ࡞Ͱ͖ΔEUBOFDD
  3. $ s3url —help #ظݶ෇͖URLΛൃߦ Usage of s3url: s3url https://s3-region.amazonaws.com/BUCKET/KEY [-d

    DURATION] s3url s3://BUCKET/KEY [-d DURATION] s3url -b BUCKET -k KEY [-d DURATION] $ ec2c —help # vagrant Ͱࢼͨ͠΋ͷΛ instance ͰݐͯΔ / tag Λ෇͚ΕΔ / ip Λ֬ೝͰ͖Δ Available commands are: launch Launch new EC2 instance list List EC2 instances tag Tag EC2 instances terminate Terminate the specified EC2 instance untag Tag EC2 instances FYTVSMFDD
  4. ࠷ۙͷऔΓ૊Έ,VCFSOFUFT ΠϯϑϥνʔϜ͸Ϋϥελͷج൫࡞Γͱπʔϧʹूத Web Application Monitoring Logging Auto Scale Load Balancer

    Internal DNS Web Application Monitoring Logging Auto Scale Load Balancer Internal DNS Web Application Monitoring Logging Auto Scale Load Balancer Internal DNS Monitoring Logging Auto Scale Load Balancer Internal DNS ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ґཔ͕͖ͨΒΠϯϑϥνʔϜ͸౎౓ߏ੒Λ͔Β࡞Δ
  5. ϞχλϦϯά ΠϯϑϥνʔϜ͸Ϋϥελͷج൫࡞Γͱπʔϧʹूத Web Application Monitoring Logging Auto Scale Load Balancer

    Internal DNS Web Application Monitoring Logging Auto Scale Load Balancer Internal DNS Web Application Monitoring Logging Auto Scale Load Balancer Internal DNS Monitoring Logging Auto Scale Load Balancer Internal DNS ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ґཔ͕͖ͨΒΠϯϑϥνʔϜ͸౎౓ߏ੒Λ͔Β࡞Δ
  6. )PXUP4DIFEVMFE+PC $ kubectl create -f examples/scheduled-job/hello-job.yaml scheduledjob "hello" created $

    kubectl get scheduledjob NAME SCHEDULE SUSPEND ACTIVE LAST-SCHEDULE hello 0/1 * * * ? False 0 Fri, 07 Oct 2016 17:23:00 +0900 hello-run 0/1 * * * ? False 0 <none> $ pods=$(kubectl get pods --selector=job-name=hello-1628211009 -- output=jsonpath={.items..metadata.name}) $ echo $pods hello-1628211009-d939p $ kubectl logs $pods Fri Oct 7 08:24:08 UTC 2016 Hello from the Kubernetes cluster
  7. πʔϧͷϕʔεͱͳΔ෦෼ΛܾΊΔ w ͳΔ΂͘ߋ৽͠΍͍͢ߏ੒ w ΫϥΠΞϯτଆʹ͸ग़དྷΔݶΓϩδοΫΛೖΕͳ͍ w ΫϥΠΞϯτଆͰ͍ͭωοτ͕੾ΕΔ͔Θ͔Βͳ͍͜ͱΛ૝ఆ͢Δ w ΫϥΠΞϯτଆʹେࣄͳ৘ใΛஔ͔ͳ͍ w

    ͳΔ΂͘όʔδϣϯΛࡉ্͔͛͘ΔৗʹΈΜͳ͕ۙ͘ʹ͍Δͱ͸ݶΒͳ͍ w ࠷௿ݶར༻Ͱ͖Δঢ়ଶ͔Β࢖ͬͯ΋Β͏ w खؒͩͱࢥ͏෦෼͔Βศརʹ͍ͯ͘͠
  8. LVCFSOFUFTΛૢ࡞Ͱ͖Δ$-* LVCFίϚϯυ Kubernetes for Wantedly kube Commands: • kube deploy

    • kube migration • kube diff • kube rollback • kube enable dotenv • kube enable private-repogitory quay • kube generate • kube tags • kube (kubectl subcommands) Container Tools: • kubectl • k8sec • slack notification(kubenotification) • deploy (kubeloy) • scheduler (?????) • ps/status (kubeps) Developer kube Server Kubernetes