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
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building Applications with DynamoDB
mza
90
6.1k
What's new in Ruby 2.0
geeforr
343
31k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Ruby is Unlike a Banana
tanoku
97
11k
It's Worth the Effort
3n
183
27k
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ͳΜͩΑͳ͊ɾɾɾɾΈͭ˔ɻ