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
Chatops, AWS, And Ansible
Search
nnao45
December 06, 2018
2
990
Chatops, AWS, And Ansible
nnao45
December 06, 2018
Tweet
Share
More Decks by nnao45
See All by nnao45
MPI Performance Evaluation of Raspberry Pi4 Cluster with Android OS
nnao45
2
160
datalake-party-for-aws-20201118
nnao45
0
230
はじめてのNetwork Service Mesh
nnao45
4
2.2k
EKS for EFS
nnao45
4
1.4k
まだ大きくない僕たちに必要なCLoud Nativeを求めて
nnao45
8
1.1k
Firebase, Firestore Find mBaaS
nnao45
3
1.1k
what happens when k8s journy
nnao45
16
9k
Make App, Using with Study Group
nnao45
3
590
Ansible container in the kubernetes
nnao45
5
1.5k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Become a Pro
speakerdeck
PRO
26
5k
Typedesign – Prime Four
hannesfritz
40
2.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
The Language of Interfaces
destraynor
154
24k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
BBQ
matthewcrist
85
9.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Bash Introduction
62gerente
608
210k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Designing for humans not robots
tammielis
250
25k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Transcript
CHATOPS,AWS, AND ANSBLE CyberAgent, inc. @nnao45 with cndjp
ˏnnao45 ✓ 27ࡀ(ฏ3ੜ·Ε) ✓ ࠓओʹΫϥυ ✓ ཱڭେֶཧֶ෦ԽֶՊଔۀ ✓ ςχεྺ10 ✓
ITྺ4 ✓ Go࠷ߴ!!zsh࠷ߴ!! ✓cndjpษڧձӡӦ ✓גࣜձࣾαΠόʔΤʔδΣϯτॴଐ ✓ ݩISPͷNWϝΠϯ $ WHOIS NNAO45
JAPAN CONTAINER DAYS!! ͓ർΕ༷Ͱͨ͠ʢɾ˜ɾʣ
JAPAN CONTAINER DAYS!! ͓ർΕ༷Ͱͨ͠ʢɾ˜ɾʣ https://speakerdeck.com/cndjp/jkd-v18-dot-12-2w3
JAPAN CONTAINER DAYS!! ͓ർΕ༷Ͱͨ͠ʢɾ˜ɾʣ https://speakerdeck.com/cndjp/jkd-v18-dot-12-2w3
SHOW CNDJP INFRASTRUCTURE ଟ͘ͷΠϯϑϥͷ՝ͱཁٻɾɾɾʂ ࣗಈతʹΫϥυ(AWS)Λબ ʮશίʔυཧxࣗಈCD͕ඞਢʯ વશίϯϙʔωϯτΛίʔυԽ कඋൣғͷ͞ͱ׳ΕͯΔͱ͍͏ ཧ༝ʹΑΓɺAnsibleΛ࠾༻ Զ͡Όͳͯ͘σϓϩΠͰ͖ΔΑ͏
SlackʹΑΔChatOpsͷ࣮ ։ൃ࣌ʮͷΈʯશΠϯϑϥΛ୭ͰσϓϩΠ ·ɺϚωʔ ͕ɾɾɾɾɻ
SHOW CNDJP INFRASTRUCTURE ଟ͘ͷΠϯϑϥͷ՝ͱཁٻɾɾɾʂ એݴతઃఆ͕ՄೳͳK8SΛ࠾༻ શίϯϙʔωϯτΛCloudformation AnsibleʹΑΓႈੑΛ֬อʂ ͞ΒʹύΠϓϥΠϯʹSpinnakerɺ όοΫΞοϓπʔϧʹHeptio/ArkΛ Λ༻ͯ͠ঢ়ଶΛ҆Ձʹอ࣋Ͱ͖Δ
ύΠϓϥΠϯΛߏங ͍ऴΘͬͨΒɺʮঢ়ଶΛอ࣋ͯ͠ʯશ෦Լ͛Δ
SHOW CNDJP INFRASTRUCTURE
SHOW CNDJP INFRASTRUCTURE ϩάऩू ࢹ τϨʔγϯά ίϯςφ ϥϯλΠϜ ίϯςφ Φʔέετϥ
ՄࢹԽ αʔϏε σΟεΧόϦ ߏཧ ΠϯϑϥCD RDS Ωϟογϡ όοΫΞοϓ ϑϩϯτ ίʔυཧ CICD ύΠϓϥΠϯ ΧφϦΞϦϦʔε+GitOps+CNΛ࣮ݱ͢ΔϛυϧΣΞ
SHOW CNDJP INFRASTRUCTURE deploy!!
SHOW CNDJP INFRASTRUCTURE destroy!!
SHOW CNDJP INFRASTRUCTURE destroy!!
THIS IS “COOL” INFRASTRUCTUREʁ
SO…BUT, AND “TURAMI”ʂ
WHAT IS THE “TURAMI” ίϯςφωΠςΟϒͳίϯςϯπσϦόϦ͕ͭΒΈ Kubernetes্ͰύΠϓϥΠϯΛ ݁ͤ͞ΔͨΊͷ੍͕ਏ͍ɻ ̍γΣϧڬΈ͍ͨͷʹɺ ֎෦ύΠϓϥΠϯʮWebhookʯ ͚ͩͩͱɾɾɾɾʂʁ
VMͰAnsibleΛ༻ҙ͕ͨ͠ɺ ૬͑ͨײ͕͋ΔʢŬŧŒŗ ύΠϓϥΠϯͷΩοΫʹγΣϧ͕ແ͍ɾɾɾʁ
WHAT IS THE “TURAMI” EKSͷAWSϦιʔεͱͷ࿈ಈͱ͔ɾɾɾɻ ϙΠϙΠ্͛Լ͛ͯͯ͠ؾ͍ͨΒɺ ELB͕200ݸҐ͋ͬͯੜ͑ͳ͍ ͦͯ͠ඥ͍ͮͯग़དྷͨϦιʔεɺ ґଘઌ͕ফ͑ͯͳ͍ͱফ͑ͳ͍ ํͳ͍͔ΒEKSͰࣗಈͰ࡞Δ
ϦιʔεΛফ͢ΈΛ࡞Δͱ͍͏ ͳΜ͔͜͏ΞϨͳؾ࣋ͪɻ EKSͷ࿈ಈσϓϩΠ͞ΕͨϦιʔε͕ফ͑ແ͍
WHAT IS THE “TURAMI” AWSωΠςΟϒͳίʔυཧʹ MySQLͱ͔RedisΛRoute53ͷ໊લ ʹඥ͚ͮͯཧ͠Α͏ͱ͢Δͱɺ ͏Cloudformationແ͍ͱେมɻ ͦ͏ͯ͠ɺ΄ͱΜͲͷAWSϦιʔε ͕CloudformationͰཧ͢Δࣄʹɻ
ΠϛϡʔλϒϧͳK8SΛ࠾༻ͨ͠ ҙຯ͕ബΕ͍ͯ͘ɾɾɾʁ ͲΜͲΜCloudformation͋Γ͖ͳߏʹɻ
TOO “TURAMI”…
BUT!! I FIND THE “YABAMI” !!
WHAT IS THE “YABAMI” ChatOpsͰʮΦϖϛεݮʯxʮѪணʯ Python3.7ͷasyncioύοέʔδͰ ඇಉظ͔ͭλεΫεέδϡʔϦϯά γϯϓϧͳChatOpsͷbotΛৗற ͢Δ͜ͱͰɺΞϓϦ։ൃऀ͕ɺ ͍ͭͰ؆୯ʹσϓϩΠՄೳ
BOTΛΩϟϥԽ͢Δ͜ͱͰɺ Ѫண͕Θ͖ɺϝϯς͞ΕΔΑ͏ʹʂ ΩοΫͤ͞ΔεΫϦϓτΛPython3Ͱߋʹॊೈʹ
WHAT IS THE “YABAMI” • • • GCPͷVMΠϯελϯεΛৗ্ཱ͓͖࣌ͪ͛ͯɺ ʮ্͛ͯʯͳͲͷૢ࡞Λ࣮ࢪ •
WHAT IS THE “YABAMI” KubernetesͷόοΫΞοϓʹʮHeptio/Arkʯ ͓͖ͳΫϥυϕϯμʹ etcdʹ֨ೲ͞ΕͨAPIίʔυΛ όοΫΞοϓ͓ͯ͘͠ͱ͍͏ͷ ඇৗʹߴͰɺಉϦʔδϣϯͳΒ ̎ඵҎͰόοΫΞοϓ/ϦετΞʂ
PVͱίϯςφAPI͕ඥ͚ͭͰ͖ͯɺ ͜ΕͰΑΓڧྗʹόοΫΞοϓɻ ʮએݴʯͷόοΫΞοϓͱ͍͏Ξϓϩʔν
WHAT IS THE “YABAMI” ͪΖΜΞʔϯγϘʔ׆༂ͨͧ͠ʂ Ͳ͏ͯ͠ϚΠΫϩαʔϏε࿈ܞ πʔϧ܈ଟ͘ͳΔ͕ɺͦͷཧʹ ႈੑΛɻ K8SΛׂඃΔʁ͍ɺׂඃΔ ͔ΒίϯςφΦʔέετϨʔγϣϯ
ʹΈࠐΈ͍͢ʂ γΣϧୟؚ͖ΊখճΓ͕ར͘ͷͰɺ ແବͳπʔϧΛ૿ͣ͞ʹࡁΉɻ कඋൣғͷ͞ɺখճΓͷྑ͞ɺK8Sͱ૬ੑ˕
$SHUTDOWN +10 ΫϥυωΠςΟϒͳπʔϧɺ ·ͩ·ͩൃల్্ͳ෦ཱ͕ͭɻ ͦͷൃల్্ͳ෦ΛͦͬͱຒΊͯ͘ΕΔɺ ͦΕ͕AnsibleͳΜͩΑͳ͊ɾɾɾɾΈͭ˔ɻ