Slide 1

Slide 1 text

©2020 Wantedly, Inc. Deploy Flow at Wantedly ن໿ͱڧ੍ FORCIA Meetup #1 ʙDevOps΍͍͔ͬͯnightʙ Mar 10, 2020 - Shimpei OTSUBO @potsbo

Slide 2

Slide 2 text

©2020 Wantedly, Inc. 4IJNQFJ0UTVCP!QPUTCP Developer Experience Squad Wantedly, Inc. Kubernetes Dev Tools CI / CD AuthN / Z Productivity Dvorak

Slide 3

Slide 3 text

©2020 Wantedly, Inc. લఏͱͳΔ Wantedly ͷ؀ڥ AWS ͕ϝΠϯ 40 Engineers 6 Infrastructure Engineers 5 Kubernetes Clusters 300 namespaces in total GCP ͕Ұ෦ ΦϯϓϨϛε͸Ұ੾ͳ͍ 99% of services are on Kubernetes 60 deploys per weekday

Slide 4

Slide 4 text

©2020 Wantedly, Inc. implement configure ask / help Wantedly ͕ආ͚Δ΍Γํ App Engineers Products infrastructure Infra Engineers

Slide 5

Slide 5 text

©2020 Wantedly, Inc. App Engineers Infra Engineers implement Access through tools and APIs Products infrastructure Provide tools automate Wantedly ͷ΍Γํ

Slide 6

Slide 6 text

©2020 Wantedly, Inc. App Engineers Infra Engineers implement Access through tools and APIs Products infrastructure Provide tools automate Wantedly ͷ΍Γํ Infra engineer ͱ App engineer ͕ૄ݁߹

Slide 7

Slide 7 text

©2020 Wantedly, Inc. ڧ੍Ͱ͖Δ࢓૊ΈΛߏங͢Δ •CI ͱϩʔΧϧͰಉҰͷπʔϧΛ࢖͏ ن໿Ͱੜ࢈ੑΛҡ࣋͢Δ •commit hash Λ tag ʹ͢Δ •ࣗಈ deploy •The Twelve Factors ʹଇΔ Ͳ͏΍Δ͔ •Interface ͷΈΛकΓཪ͸υϥεςΟοΫʹม͍͑ͯ͘

Slide 8

Slide 8 text

©2020 Wantedly, Inc. ن໿ same third-party services across all services commit hash Λ image tag PR merge Ͱࣗಈ deploy build/deploy monitoring etc… ಉҰͷ docker image Λશ؀ڥͰ࢖͏

Slide 9

Slide 9 text

©2020 Wantedly, Inc. The Latest k8s ops flow set image check pull deploy push push hook build build

Slide 10

Slide 10 text

©2020 Wantedly, Inc. 1 commit ʹରͯ͠ 1 docker image GitHub commit status Ͱ image ͷ࡞੒ঢ়گΛ feedback ΄΅͢΂ͯͷ commit ͕ deploy Մೳ push push hook build build The Latest k8s ops flow

Slide 11

Slide 11 text

©2020 Wantedly, Inc. `kube prod deploy master` Ͱ deploy `kubectl set image` Λ wrap ͍ͯ͠Δ શ؀ڥͰಉҰͷ image Λ࢖͍؀ڥม਺͚͕ͩࠩ෼ set image check pull deploy The Latest k8s ops flow ࣗಈͰ deploy ͞ΕΔ

Slide 12

Slide 12 text

©2020 Wantedly, Inc. ن໿Ͱੜ࢈ੑΛҡ࣋͢Δ •commit hash Λ tag ʹ͢Δ •ࣗಈ deploy •The Twelve Factors ʹଇΔ

Slide 13

Slide 13 text

©2020 Wantedly, Inc. ඞཁͳ΋ͷ͕͢΂ͯἧ͏ࣾ಺ϥΠϒϥϦ servicex • Log format ͱૹ৴ • Error ऩू • ύϑΥʔϚϯεϞχλϦϯά • ෼ࢄτϨʔγϯά • ଞͷαʔϏε Golang, Ruby, Python, Node Λαϙʔτ ڧ੍Ͱ͖Δ࢓૊ΈΛߏங͢Δ ϧʔϧΛकΔͷ͕Ұ൪؆୯Ͱ͋ΔੈքΛҡ࣋͢Δ

Slide 14

Slide 14 text

©2020 Wantedly, Inc. ڧ੍Ͱ͖Δ࢓૊ΈΛߏங͢Δ ͢΂ͯͷ ops ͕ kube ίϚϯυͰՄೳ ϧʔϧΛकΔͷ͕Ұ൪؆୯Ͱ͋ΔੈքΛҡ࣋͢Δ ࣾ಺πʔϧͰ build / deploy / ops ͷ͢΂ͯͷ࡞ۀ͕Մೳ CI Ͱ΋ laptops Ͱ΋ಉ͡΋ͷΛ࢖͏ ͲΜͳࣗಈԽ͕ߦΘΕ͍ͯΔͷ͔Θ͔Γ΍͍͢ kube build kube prod deploy master Ͱ docker image Λ build ͯ͠ push Ͱ production ΁ deploy Ͱੜ੒ manifests ࣗಈੜ੒ kube generate autoscale

Slide 15

Slide 15 text

©2020 Wantedly, Inc. language: bash env: - // encrypted credentials here install: - bash <(curl -sL https://get.wantedlyapp.com/kube) script: - kube build deploy: - skip_cleanup: true provider: script script: kube prod deploy $TRAVIS_COMMIT on: branch: master Travis ͷઃఆͷྫ

Slide 16

Slide 16 text

©2020 Wantedly, Inc. language: bash env: - // encrypted credentials here install: - bash <(curl -sL https://get.wantedlyapp.com/kube) script: - kube build deploy: - skip_cleanup: true provider: script script: kube prod deploy $TRAVIS_COMMIT on: branch: master Install kube Travis ͷઃఆͷྫ

Slide 17

Slide 17 text

©2020 Wantedly, Inc. language: bash env: - // encrypted credentials here install: - bash <(curl -sL https://get.wantedlyapp.com/kube) script: - kube build deploy: - skip_cleanup: true provider: script script: kube prod deploy $TRAVIS_COMMIT on: branch: master Install kube build and push a docker image Travis ͷઃఆͷྫ

Slide 18

Slide 18 text

©2020 Wantedly, Inc. language: bash env: - // encrypted credentials here install: - bash <(curl -sL https://get.wantedlyapp.com/kube) script: - kube build deploy: - skip_cleanup: true provider: script script: kube prod deploy $TRAVIS_COMMIT on: branch: master deploy the revision Install kube build and push a docker image Travis ͷઃఆͷྫ

Slide 19

Slide 19 text

©2020 Wantedly, Inc. Travis ͷઃఆͷྫ language: bash env: - // encrypted credentials here install: - bash <(curl -sL https://get.wantedlyapp.com/kube) script: - kube build deploy: - skip_cleanup: true provider: script script: kube prod deploy $TRAVIS_COMMIT on: branch: master deploy the revision Install kube build and push a docker image Interface ͑͞ม͑ͳ͚Ε͹৽͍͠มߋΛ؆୯ʹ͹Β·͚Δ ࣾ಺ඪ४ͷπʔϧΛ࢖͏ͷ͕Ұ൪ָͩ͠উखʹྑ͘ͳΔ Infra Engineers App Engineers

Slide 20

Slide 20 text

©2020 Wantedly, Inc. ڧ੍Ͱ͖Δ࢓૊ΈΛߏங͢Δ •CI ͱϩʔΧϧͰಉҰͷπʔϧΛ࢖͏ ن໿Ͱੜ࢈ੑΛҡ࣋͢Δ •commit hash Λ tag ʹ͢Δ •ࣗಈ deploy •The Twelve Factors ʹଇΔ Ͳ͏΍Δ͔ •Interface ͷΈΛकΓཪ͸υϥεςΟοΫʹม͍͑ͯ͘