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
980
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
220
はじめてのNetwork Service Mesh
nnao45
4
2.1k
EKS for EFS
nnao45
4
1.4k
まだ大きくない僕たちに必要なCLoud Nativeを求めて
nnao45
8
1.1k
Firebase, Firestore Find mBaaS
nnao45
3
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
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Code Review Best Practice
trishagee
64
17k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
What's new in Ruby 2.0
geeforr
343
31k
YesSQL, Process and Tooling at Scale
rocio
169
14k
How STYLIGHT went responsive
nonsquared
95
5.2k
Visualization
eitanlees
145
15k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Making Projects Easy
brettharned
115
5.9k
The Pragmatic Product Professional
lauravandoore
31
6.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ͳΜͩΑͳ͊ɾɾɾɾΈͭ˔ɻ