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
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Facilitating Awesome Meetings
lara
50
6.1k
How GitHub (no longer) Works
holman
311
140k
The Pragmatic Product Professional
lauravandoore
32
6.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
A better future with KSS
kneath
238
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Gamification - CAS2011
davidbonilla
80
5.1k
How to train your dragon (web standard)
notwaldorf
88
5.7k
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ͳΜͩΑͳ͊ɾɾɾɾΈͭ˔ɻ