Slide 1

Slide 1 text

Cacoo ͸ͳͥ Kubernetes ʹΑΔ microservices ΁ͷಓΛબΜͩͷ͔ʁ Alternative Architecture DOJO Offline #1

Slide 2

Slide 2 text

ϒϩάಡΜͰͶɻ͓ΘΓ

Slide 3

Slide 3 text

- Cacoo ͷ։ൃνʔϜ͕ͲΜͳ՝୊Λ๊͍͔͑ͯͨ - Կނ microservices ͷಓΛબΜ͔ͩ - ͲΜͳٕज़ΛબΜ͔ͩ - microservices Խͯ͠Ͳ͏͔ͩͬͨ - ݱঢ়ͷ՝୊

Slide 4

Slide 4 text

Kohei Kimura @cohhei 2018೥1݄ Nulab ೖࣾ Cacoo νʔϜͷόοΫΤϯυΤϯδχΞ ΄΅ Go ෱Ԭ

Slide 5

Slide 5 text

Cloud-based diagrams, the easy way. Diagram maker for companies, teams, and you

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

՝୊1: ϞϊϦγοΫͳΞϓϦέʔγϣϯ

Slide 8

Slide 8 text

ґଘؔ܎ Ξοϓσʔτ Πϯϑϥ ։ൃޮ཰ ௐࠪ ։ൃޮ཰ Өڹௐࠪ ϨΨγʔ ίϛϡχ έʔγϣϯ ϞϊϦε ίϛϡχ έʔγϣϯ ϦϙδτϦ Ωϟον Ξοϓ CI/CD εέʔϧ ίϛϡχ έʔγϣϯ

Slide 9

Slide 9 text

՝୊2: ϝϯςφϯε͕ऴྃͨ͠ ϑϨʔϜϫʔΫ΍ϥΠϒϥϦ

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

✓ αʔϏε͝ͱʹٕज़Λબ୒Ͱ͖Δ ✓ ෦෼తͳมߋ͕༰қʹͳΔ ✓ ʢ͏·͘ઃܭͰ͖Ε͹ʣαʔόʔϦιʔεΛ࠷దԽͰ͖Δ ✓ ʢ͏·͘ઃܭͰ͖Ε͹ʣݎ࿚ͳγεςϜʹͳΔ microservices

Slide 14

Slide 14 text

໨ඪ: มߋΛ༰қʹ

Slide 15

Slide 15 text

micro services ෳ਺ͷαʔϏεͱDB ϑϩϯτΤϯυͷ෼ׂ ҟͳΔٕज़ ϨΨγʔͷߋ৽

Slide 16

Slide 16 text

ํ਑ɾݪଇ

Slide 17

Slide 17 text

- ໌֬ͳΦʔφʔγοϓ - খ͍͞΄Ͳྑ͍ - εΫϥον͔Βॻ͖ͳ͓ͯ͠ΈΔ - αʔϏεؒͷΠϯλʔϑΣʔε͸ڧ͍ܕ෇͚ - ։ൃ؀ڥ͸αʔϏε͝ͱʹࣗ༝ʹબ୒ - ϕετϓϥΫςΟεʹै͏

Slide 18

Slide 18 text

ٕज़ελοΫ

Slide 19

Slide 19 text

Backend/Middleware - Kubernetes - Protocol Buffers - gRPC - RabbitMQ - Go Monitoring/Alerting - Elasticsearch + Kibana - Prometheus + Grafana - Zipkin

Slide 20

Slide 20 text

Dashboard Editor

Slide 21

Slide 21 text

Dashboard

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Editor

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Dashboard Editor

Slide 27

Slide 27 text

microservices ԽͷྲྀΕ

Slide 28

Slide 28 text

EC2ظ Kubernetesظ ECSظ - ৽͍͠ػೳΛผαʔϏεͰ - طଘػೳΛ੾Γग़ͯ͠Dockernize - μογϡϘʔυͷαʔϏε - ECS ͷαʔϏεΛҠߦ

Slide 29

Slide 29 text

region region Production Cluster Testing Cluster cacoo cacoo-beta cacoo-testing-e2e cacoo-testing-load cacoo monitoring monitoring storages storages namespaces namespaces stress test by selenium

Slide 30

Slide 30 text

Scaling - Horizontal Pod Autoscaler - Cluster Autoscaler

Slide 31

Slide 31 text

Monitoring / Alerting

Slide 32

Slide 32 text

Logging stdout ops

Slide 33

Slide 33 text

Metrics - Prometheus & Grafana

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Metrics - goroutines - memory ͳͲ Alerting - Pod ͷ਺͕൒෼ҎԼʹͳͬͨͱ͖ - Τϥʔ͕େྔʹग़ͨͱ͖ ͳͲ

Slide 36

Slide 36 text

Zipkin

Slide 37

Slide 37 text

https://zipkin.io/pages/architecture.html HTTP

Slide 38

Slide 38 text

Backend/Middleware - Kubernetes - Protocol Buffers - gRPC - RabbitMQ - Go Monitoring/Alerting - Elasticsearch + Kibana - Prometheus + Grafana - Zipkin

Slide 39

Slide 39 text

ͰɺͲ͏ʁ

Slide 40

Slide 40 text

ґଘؔ܎ ‑ - ෦෼తͳมߋ͠΍͘͢ͳͬͨ - ϏϧυɾσϓϩΠ͕ߴ଎ - ෱ԬνʔϜ 㱻 ւ֎νʔϜ͕ಠཱ - Protocol Buffers ͷߋ৽ - ը໘Λލ͙ػೳͷ։ൃ ͷͱ͖

Slide 41

Slide 41 text

PR/issue Ͱͷίϛϡχέʔγϣϯ

Slide 42

Slide 42 text

νϟοτͰͷίϛϡχέʔγϣϯ

Slide 43

Slide 43 text

՝୊: ৽͍͠ෳࡶੑ

Slide 44

Slide 44 text

- Seasar ΁ͷґଘ͸࢒͍ͬͯΔ - αʔϏεΛͲ͜Ͱ۠੾Δ͔ - αʔϏε௥Ճ͗͢͠ΔͱΠϯϑϥͷෛ୲Ὄ - ίʔυ/yamlͷ৑௕ੑ - DB Λ·͍ͨͩτϥϯβΫγϣϯ

Slide 45

Slide 45 text

·ͱΊ

Slide 46

Slide 46 text

Cacoo ͷ՝୊ - ݹ͍ϑϨʔϜϫʔΫ - ϞϊϦγοΫͳΞϓϦέʔγϣϯͷڧ͍ґଘؔ܎ - ଟڌ఺Ͱͷ։ൃ ͦΕΒΛղܾ͢ΔͨΊʹ microservices Խ - খ͘͞࡞ͬͯ࿈ܞ - গͣͭ͠෼ׂͯ͠ ECS ্Ͱӡ༻ - ͦͷޙ Kubernetes ΁

Slide 47

Slide 47 text

- ΞϓϦέʔγϣϯͷڥքͱΦʔφʔγοϓ͕໌֬ʹ - ܧଓతͳ։ൃ͕͠΍͘͢ͳͬͨ - ෦෼తʹมߋ͠΍͍͢ - ߴ଎ͳϏϧυɾσϓϩΠ - ·ͩ·ͩվળ͕ඞཁ

Slide 48

Slide 48 text

࠷ޙʹ

Slide 49

Slide 49 text

࢖ͬͯͶɻ

Slide 50

Slide 50 text

Appendix

Slide 51

Slide 51 text

Protocol Buffers - αʔϏεؒͷσʔλεΩʔϚ - .proto ϑΝΠϧʹఆٛ - Cacoo Ͱ୯Ұͷ proto ϦϙδτϦ → git submodule Ͱ֤αʔϏεʹ௥Ճ - ιʔείʔυΛੜ੒

Slide 52

Slide 52 text

- GraphQL service -> gRPC services - gRPC services ؒ΋ gRPC - ΞΧ΢ϯτɺϑΥϧμʔɺਤ ͳͲ

Slide 53

Slide 53 text

cacoo-service-account cacoo-service-organization cacoo-service-diagram cacoo-service-folder cacoo-service-subscription cacoo-service-integration Main GraphQL service

Slide 54

Slide 54 text

RabbitMQ - ෳ਺ͷϝοηʔδϯάύλʔϯ - WorkQueue - Publish/Subscribe - Routing - Topics - RPC - ΤσΟλʔͷฤूΠϕϯτΛ௨஌͢Δ ͳͲ - εΩʔϚ͸ Protocol Buffers Ͱఆٛ - DB ʹฒͿॏཁͳཁૉ

Slide 55

Slide 55 text

Kubernetes - OSS - ΤίγεςϜͷڧ͞ - ྫ: helm