Slide 1

Slide 1 text

ೖࣾ1ϲ݄Ͱ͜͜·Ͱ΍ͬͨʂ Findy ToolsΠϯϑϥࢧԉͷ࠷దԽ ʮ2024/7/11 Findy TechBrew in ౦ژEmbedded SRE ݱ৔ʹدΓఴ͏Ξϓϩʔνʯ ϑΝΠϯσΟגࣜձࣾ ϓϩμΫτ։ൃ෦/SRE ҆ୡ ྋ(adachin0817)

Slide 2

Slide 2 text

ࣗݾ঺հ

Slide 3

Slide 3 text

3 ࣗݾ঺հ Findy / ϓϩμΫτ։ൃ෦ / SRE ҆ୡ ྋ/ Adachi Ryo ɹɹ@adachin0817 blog.adachin.me/wiki.adachin.me(k8s) ɾ2024೥6݄ʹϑΝΠϯσΟ/SREͱͯ͠ೖࣾ ɹɾ௚ۙFindy ToolsͱηΩϡϦςΟपΓվળͯ͠·͢ • ޷͖ͳ͜ͱ🎮 ɾϑϨϒϧɺPS5ɺΨδΣολʔɺHIPHOP/KPOP🇰🇷 • ݸਓ׆ಈ📖 • MENTA/TechBullͰະܦݧΠϯϑϥΤϯδχΞͷҭ੒(300ਓಥഁ) ৄ͘͠͸ʮϞνϕͷઘʯΈΜͳݟͯʂʂ

Slide 4

Slide 4 text

XͰݟ͔͚ͨਓʂ 🤚

Slide 5

Slide 5 text

ೖࣾͯ͠·ͩ1ϲ݄ʂʂ φχϞϫΧϥφΠ

Slide 6

Slide 6 text

SREνʔϜൃ଍ʹ͍ͭͯ

Slide 7

Slide 7 text

SREνʔϜൃ଍ʹ͍ͭͯ ● όοΫΤϯυνʔϜ͕SREతͳ׆ಈΛ͍ͯͨ͠ ○ ͔͠͠ɺόοΫΤϯυνʔϜ͕Πϯϑϥ΋ରԠͱͳΔͱϦιʔεෆ଍ ○ αʔϏε͕૿͑ଓ͚ΔҰํɺSREతվળ͕ͳ͔ͳ͔Ͱ͖͍ͯͳ͔ͬͨ ● ڈ೥͔Β࠾༻Λ࢝ΊͯɺSREνʔϜ͸ݱࡏ3໊Ͱ׆ಈ ○ GitHubͷΧϯόϯํࣜͰλεΫ؅ཧ͓ͯ͠Γɺேձ͸15෼Ͱ׬݁ 7

Slide 8

Slide 8 text

Findy Tools͔Βࢧԉ͍ͯ͜͠͏ʂ

Slide 9

Slide 9 text

Findy Toolsͱ͸

Slide 10

Slide 10 text

Findy Toolsͱ͸ ● ։ൃπʔϧʹಛԽͨ͠ϨϏϡʔαΠτ ○ πʔϧબఆʹؔ͢Δෆ҆Λղফ ○ ಋೖݕ౼ʹඞཁͳ৘ใΛఏڙ ● ݱ৔ͰΑ͋͘Δ͓೰Έ ○ ϝϦοτɾσϝϦοτ͕෼͔Βͳ͍ ○ ৘ใऩूʹ͕͔͔࣌ؒΔ ○ πʔϧબఆͷܾఆଧ ○ ಋೖޙʹൃੜ͢Δ՝୊఺ ● ͓͔͛͞·Ͱͨ͘͞Μͷʂ ○ ձ༷ࣾʹࣥච͍͍͓ͨͩͯΓ·͢ʂ 10

Slide 11

Slide 11 text

Findy Toolsͷٕज़ελοΫ

Slide 12

Slide 12 text

Findy Toolsͷٕज़ελοΫ ● Ruby on Rails ● Next.js ● Docker ● AWS ○ ECS/Fargate ■ Front Container ■ Rails Container ■ Nginx Container ● ALB ○ CloudFront ○ Aurora/MySQL8 ○ WAF ● GitHub Actions(CI/CD) ● Terraform(Module) ● Datadog/Sentry 12

Slide 13

Slide 13 text

औΓ૊Μͩ͜ͱ (Aurora όʔδϣϯΞοϓ) ͦͷᶃ

Slide 14

Slide 14 text

Aurora όʔδϣϯΞοϓ ● RDS SSL/TLSূ໌ॻͷߋ৽ ○ ଞʹӨڹ͕ͳ͍Α͏ʹrds-ca-2019ͱಉ͡ΞϧΰϦζϜͷRSA2048Λ࢖༻͍ͯ͠Δ ○ rds-ca-rsa2048-g1ʹมߋ ○ ࠶ىಈ΍μ΢ϯλΠϜ͸ͳ͍ͷͰαΫοͱ׬ྃ ● Aurora MySQLϚΠφʔόʔδϣϯΞοϓ ○ 8.0.mysql_aurora.3.04.0→8.0.mysql_aurora.3.07.0 ■ μ΢ϯλΠϜ͋Δ͔໰୊ʹ͍ͭͯݒ೦ ■ ·ͣ͸։ൃ؀ڥ(Docker)͔ΒόʔδϣϯΞοϓͱಈ࡞֬ೝ ○ ͜ͷػձʹAmazon Aurora Blue/Green DeploymentsΛݕূ ■ ͔͠͠1࣌ؒҎ্͔͔ΔͨΊɺStgͰͦͷ··όʔδϣϯΞοϓ(10෼) ○ ࠶ىಈ΍μ΢ϯλΠϜ͸ͳ͔ͬͨͷͰɺ೔தʹରԠͯ͠ຊ൪׬ྃ 14 ʮೖࣾͯ͠Θ͔ͣ3೔ͰରԠʂʯ

Slide 15

Slide 15 text

औΓ૊Μͩ͜ͱ (؂ࢹ/ΦϒβʔόϏϦςΟ) ͦͷᶄ

Slide 16

Slide 16 text

؂ࢹ/ΦϒβʔόϏϦςΟ ● ؂ࢹ/ΦϒβʔόϏϦςΟपΓ ○ ࠓ·ͰSentryͰΤϥʔτϥοΩϯάͱAPMͷΈ͚ͩ ○ Մ؍ଌੑେࣄͳͷͰ΍͍͖ͬͯ ● ։ൃϝϯόʔ͸3໊ ○ ϝϯόʔͱग़ࣾ࣌ʹ1on1 ■ ձ࿩͍ͯ͘͠தͰDatadogͰ౷Ұ͢Δ͜ͱʹͳͬͨ ■ ΤϥʔτϥοΩϯά͸Sentryͷํ͕͍҆ͨΊܧଓ ■ APM͸DatadogʹҠߦ ● Πϯϑϥ/ΞϓϦέʔγϣϯϦιʔε ○ ECS(CPU,Memory) ○ ֎ܗ؂ࢹ(Response Time,Status Code) ○ CloudFront(5xx,Error Rate) ○ APM(Error,Latency) ○ RDS(CPU,Memory,DeadLock,Network,Connection,Select Latency) ○ Πϕϯτϩά(Error,Fail) ○ Ξϥʔτ͸શͯTerraformԽɺμογϡϘʔυ͸खಈͰ؅ཧ 16

Slide 17

Slide 17 text

؂ࢹ/ΦϒβʔόϏϦςΟ 17 ʮීஈݟ͍͑ͯͳ͔ͬͨ෦෼͕ɺΦϒβʔόϏϦςΟͷ ޲্ʹΑͬͯՄࢹԽ͞Εͨʂʯ

Slide 18

Slide 18 text

औΓ૊Μͩ͜ͱ (SLI/SLO) ͦͷᶅ

Slide 19

Slide 19 text

SLI/SLO ● SLI/SLOͷࡦఆ ○ SLI/SLOͷӡ༻͸γϯϓϧͳߏ੒Ͱ࣮ݧ͍ͯ͘͠ ■ τοϓϖʔδͷͦͷଞͷϖʔδͷද͕ࣔ࣌ؒ2ඵҎ಺Ͱ͋Δׂ߹͕99%Ҏ্ ■ τοϓϖʔδ΍ͦͷଞͷϖʔδͷϦΫΤετॲཧ੒ޭ཰͕99%Ҏ্ ● HTTPεςʔλείʔυ 4xxҎ֎ ■ ΤϥʔόδΣοτ ● 30೔ؒʹ0.1%ͷμ΢ϯλΠϜ͕100%ফඅ͞Εͨ৔߹ ■ όʔϯϨʔτ ● 30೔ؒʹ6͓࣌ؒΑͼաڈ30෼ؒͰ6ഒҎ্ͷ৔߹ ■ আ֎ ● ΠϯϑϥϦιʔε ○ CPUɺMemoryɺωοτϫʔΫɺσΟεΫ ○ සൟʹΞϥʔτ͕ग़ΔͨΊαʔϏεͷӨڹʹ͸ͳΒͳ͍ ■ ৼΓฦΓ ● ִिͰSLOͷݟ௚͠Λߦ͏ 19

Slide 20

Slide 20 text

SLI/SLO 20 ʮࠓޙ͸։ൃϝϯόʔ͕ӡ༻Ͱ͖ΔΑ͏ʹSRE͕ ϑΥϩʔ͍ͯ͘͠ʂʯ

Slide 21

Slide 21 text

औΓ૊Μͩ͜ͱ (։ൃ؀ڥͷվળ) ͦͷᶆ

Slide 22

Slide 22 text

։ൃ؀ڥͷվળ ● ։ൃ؀ڥΛJustfileԽͯࣗ͠ಈߏங ○ ։ൃ؀ڥ ■ rails server ■ Node.js(npm run) ■ MySQL8(docker-compose) ○ ࠓ·Ͱ͸खॱॻΛݟͳ͕Βߏங͍ͯͨ͠ ■ खॱ͕ଟ͍ͨΊ࿙Ε͕ൃੜͯ͠͠·͏ ○ Justfile(Task Runner Tool) ■ https://github.com/casey/just ■ Makefileͱൺֱ͢Δͱ ● γϯϓϧͰ௚ײతͳߏจ ● γΣϧεΫϦϓτʹࣅͯΔ ● ґଘؔ܎ͷ؅ཧ͕؆୯ ● ֶशίετ͕௿͍ 22

Slide 23

Slide 23 text

։ൃ؀ڥͷվળ(justfile) 23 ʮ։ൃϝϯόʔ͕εϐʔσΟʔʹߏஙͰ͖ΔΑ͏ʹʂʯ

Slide 24

Slide 24 text

·ͱΊ/ࠓޙ΍Γ͍ͨ͜ͱ

Slide 25

Slide 25 text

·ͱΊ/ࠓޙ΍Γ͍ͨ͜ͱ ● ৴པੑͱจԽͮ͘Γ͸ձ࿩Ͱ͢ ○ ີʹؔΘΓͳ͕Βࢧԉ͍ͯ͘͠ ● Findy ToolsͰ࣮ݧతʹߦ͍ͬͯΔ؂ࢹपΓ ○ ૊৫ԣஅʹΑΔϊ΢ϋ΢Λڞ༗ ■ Findy ■ Findy Freelance ■ Findy Team+ ● AWSηΩϡϦςΟपΓ޲্ ● AWSίετ࡟ݮ ● ։ൃϝϯόʔ΁ͷੜ࢈ੑ޲্ ○ ։ൃ؀ڥ ׬શDockerԽ ○ ECS ArmҠߦ ○ Stgෳ਺؀ڥ ࣗಈߏங ○ σϓϩΠߴ଎Խ 25

Slide 26

Slide 26 text

࠷ޙʹʂ

Slide 27

Slide 27 text

গ͠Ͱ΋ϑΝΠϯσΟͰಇ͘͜ͱʹ͝ڵຯ͋Ε͹ɺؾܰʹ͝࿈བྷ͍ͩ͘͞ʂ Ͳ͕͜దਖ਼͔Θ͔Βͳ͍ͱ͍͏ํ΋ؚΊͯɺΦʔϓϯϙδγϣϯ(ॻྨબߟ΍໘ஊ࣌ʹϙδγϣϯ͢Γ߹Θͤ)΍ΧδϡΞϧ໘ஊͷਃࠐΈΛߦ͍ͬͯ·͢ʂ 27 ※ืूঢ়گʹΑͬͯมಈ͠·͢ ։ൃνʔϜɾσβΠφʔ ● CTOީิ ● EM ● ϑϩϯτΤϯυ ● ػցֶशΤϯδχΞ ● όοΫΤϯυ ●σʔλΤϯδχΞ ● SRE ● UIσβΠφʔ Findy Career ● ࣄۀ෦௕ީิ ● ϚʔέςΟϯά ● ࣄ຿Ξγελϯτ ● PdM ● ΧελϚʔαΫηε ○ Ϧʔμʔީิ / ϝϯόʔ ● ϢʔβʔαΫηε ○ Ϧʔμʔީิ / ϝϯόʔ Findy Team+ ● ৽نࣄۀ։ൃ ● ηʔϧε ● ΧελϚʔαΫηε ● PdM ւ֎ਪਐ ● ্ཱͪ͛ϝϯόʔ ○ ϢʔβʔରԠ ○ اըରԠ ࣾ௕ࣨ ● ࣾ௕ࣨ௕ީิ ● ࠾༻૊৫ਓࣄϦʔμʔ ● ޿ใ୲౰ ίʔϙϨʔτଞ ● CFOީิ ● ܦӦاը ● ๏຿ ● ্৔४උ୲౰ ● ࣄۀاը ● ܦཧ ืूதͷϙδγϣϯ

Slide 28

Slide 28 text

SREΛେืूதʂ🥹 ઈࢍϩʔυϚοϓΛ࡞੒தͰ͢ʂʂ ڵຯ͋Δํʂͥͻ๻ͱ͓࿩͠·͠ΐ͏ʂʂ🤝 (δϡχΞ΋ҭ੒͠·͢ʂ) \ ಛ ʹ ʂ/

Slide 29

Slide 29 text

͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ