Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deploy Flow at Wantedly

Deploy Flow at Wantedly

Wantedly の Deploy Flow の解説です。
規約とそれを強制する仕組みとして Wantedly が行っていることを紹介しています。

Shimpei Otsubo

March 10, 2020
Tweet

More Decks by Shimpei Otsubo

Other Decks in Technology

Transcript

  1. ©2020 Wantedly, Inc. Deploy Flow at Wantedly ن໿ͱڧ੍ FORCIA Meetup

    #1 ʙDevOps΍͍͔ͬͯnightʙ Mar 10, 2020 - Shimpei OTSUBO @potsbo
  2. ©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
  3. ©2020 Wantedly, Inc. implement configure ask / help Wantedly ͕ආ͚Δ΍Γํ

    App Engineers Products infrastructure Infra Engineers
  4. ©2020 Wantedly, Inc. App Engineers Infra Engineers implement Access through

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

    tools and APIs Products infrastructure Provide tools automate Wantedly ͷ΍Γํ Infra engineer ͱ App engineer ͕ૄ݁߹
  6. ©2020 Wantedly, Inc. ڧ੍Ͱ͖Δ࢓૊ΈΛߏங͢Δ •CI ͱϩʔΧϧͰಉҰͷπʔϧΛ࢖͏ ن໿Ͱੜ࢈ੑΛҡ࣋͢Δ •commit hash Λ

    tag ʹ͢Δ •ࣗಈ deploy •The Twelve Factors ʹଇΔ Ͳ͏΍Δ͔ •Interface ͷΈΛकΓཪ͸υϥεςΟοΫʹม͍͑ͯ͘
  7. ©2020 Wantedly, Inc. ن໿ same third-party services across all services

    commit hash Λ image tag PR merge Ͱࣗಈ deploy build/deploy monitoring etc… ಉҰͷ docker image Λશ؀ڥͰ࢖͏
  8. ©2020 Wantedly, Inc. The Latest k8s ops flow set image

    check pull deploy push push hook build build
  9. ©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
  10. ©2020 Wantedly, Inc. `kube prod deploy master` Ͱ deploy `kubectl

    set image` Λ wrap ͍ͯ͠Δ શ؀ڥͰಉҰͷ image Λ࢖͍؀ڥม਺͚͕ͩࠩ෼ set image check pull deploy The Latest k8s ops flow ࣗಈͰ deploy ͞ΕΔ
  11. ©2020 Wantedly, Inc. ඞཁͳ΋ͷ͕͢΂ͯἧ͏ࣾ಺ϥΠϒϥϦ servicex • Log format ͱૹ৴ •

    Error ऩू • ύϑΥʔϚϯεϞχλϦϯά • ෼ࢄτϨʔγϯά • ଞͷαʔϏε Golang, Ruby, Python, Node Λαϙʔτ ڧ੍Ͱ͖Δ࢓૊ΈΛߏங͢Δ ϧʔϧΛकΔͷ͕Ұ൪؆୯Ͱ͋ΔੈքΛҡ࣋͢Δ
  12. ©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
  13. ©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 ͷઃఆͷྫ
  14. ©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 ͷઃఆͷྫ
  15. ©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 ͷઃఆͷྫ
  16. ©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 ͷઃఆͷྫ
  17. ©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
  18. ©2020 Wantedly, Inc. ڧ੍Ͱ͖Δ࢓૊ΈΛߏங͢Δ •CI ͱϩʔΧϧͰಉҰͷπʔϧΛ࢖͏ ن໿Ͱੜ࢈ੑΛҡ࣋͢Δ •commit hash Λ

    tag ʹ͢Δ •ࣗಈ deploy •The Twelve Factors ʹଇΔ Ͳ͏΍Δ͔ •Interface ͷΈΛकΓཪ͸υϥεςΟοΫʹม͍͑ͯ͘