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

Codemotion_Berlin_-_6_weeks_to_migrate.pdf

Codemotion
November 12, 2019

 Codemotion_Berlin_-_6_weeks_to_migrate.pdf

Few months ago I met a team: 8 developers working on a B2C app of car renting. They were tired, so tired ... Their vagrant was slow, the server crashed two or three times a week without restarting and without any logs, a roll out to production took 2 days to be tested, by hand ... Together we decided to react, let's have the Roll's Royce of the development environnement! Thus I've dockerized the app, I've created a Kubernetes cluster, I've added Spinnaker to the loop and some other stuff. We had some up and down, some smiles and tears, but we finally did it and we have no regrets.

About:

Aurore Malherbes, CTO - Padok

Working as a developer, I encountered many issues along with my different projects: it took 1 day and a half to install the app on my personal laptop, the deployment is not working and I do not understand why ... That's why I decided to understand the ops world and I co-founded Padok a company helping you to take the advantages of the cloud to develop faster.

Maxime Sraïki, Architect Developer & Coach - BAM

My name is Maxime Sraïki and I fell in love with development in a startup weekend coding an objective C application. I've been working in web development @Theodo for one year and then joined BAM to build awesome mobile applications using React-Native where I've been happily working as an architect for the past three years. A few things about me: - I've developed the new Linkee (redistribution of unsold food to those in need) mobile application & backend voluntarily - I've always been attracted to far east lands & languages - I sing in musicals on spare time ;)

Codemotion

November 12, 2019
Tweet

More Decks by Codemotion

Other Decks in Technology

Transcript

  1. 2 year long POC mindset 2017 2018 2019 March Start

    with a series of few weeks POC August 2 months to deliver free floating February 140 bugs Wake up call @AuroreMalherbes @MaximeSraiki
  2. Docker - one recipe @AuroreMalherbes @MaximeSraiki 1) Do not use

    the latest image 2) Move your good old monolithe entirely
  3. Docker - one recipe @AuroreMalherbes @MaximeSraiki 1) Do not use

    the latest image 2) Move your good old monolithe entirely
  4. Docker - one recipe @AuroreMalherbes @MaximeSraiki 1) Do not use

    the latest image 2) Move your good old monolithe entirely 3) Changes will be needed
  5. Docker - one recipe @AuroreMalherbes @MaximeSraiki 1) Do not use

    the latest image 2) Move your good old monolithe entirely 3) Changes will be needed - Assets storage - Clients’ IP checking - Templates’ sharing - ...
  6. Docker - one recipe @AuroreMalherbes @MaximeSraiki 1) Do not use

    the latest image 2) Move your good old monolithe entirely 3) Changes will be needed - Asset storage - Clients’ IP checking - Templates’ sharing - ... 4) Ask for developers expectations first
  7. Docker - one recipe @AuroreMalherbes @MaximeSraiki 1) Do not use

    the latest image 2) Move your good old monolithe entirely 3) Changes will be needed - Asset storage - Clients’ IP checking - Templates’ sharing - ... 4) Ask for developers expectations first 5) Migrate your local env once you’ve migrate everything
  8. @AuroreMalherbes @MaximeSraiki A practical example A developper updates the nginx

    configuration with the certificates path As we were created our first web interface, we decided to setup https endpoints He does this modification only on staging via ssh and doesn’t modify ansible roles System is down
  9. @AuroreMalherbes @MaximeSraiki Our new flow Push to master branch Build

    a docker image Run tests Push it to GCR Deploy new image Rolling update
  10. @AuroreMalherbes @MaximeSraiki What would I do differently? Push to master

    branch Build a docker image Run tests Push it to GCR Deploy new image Rolling update https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/helm
  11. “Pros” creating cons As we were the our own sys

    admin, we could handle things the far west way We did not know how to monitor traffic requests and could only rely on application logs As we were always able to go and access live logs, we were not very rigourous on logs implementation @AuroreMalherbes @MaximeSraiki
  12. Limited alerting We created a simple healthcheck, exposing a HEAD

    route and pinging it thanks to uptime robot @AuroreMalherbes @MaximeSraiki
  13. What have we planned? @AuroreMalherbes @MaximeSraiki 1) Having all services

    logs 2) Having server metric 3) Having APM 4) Having external services monitoring 5) Having monitoring on critical application paths
  14. We were discerning limits of our infrastructure We were storing

    customers identity files and licences images on the file system Our node server was under heavier load everyday Our logs were sent via http request for each occurence We were using more and more crons harvesting our database for recurring tasks @AuroreMalherbes @MaximeSraiki
  15. Forest Admin API Ingress FA Service API Service What have

    we done? @AuroreMalherbes @MaximeSraiki
  16. Forest Admin API Bucket Postgres Database Ingress FA Service API

    Service What have we done? @AuroreMalherbes @MaximeSraiki
  17. Forest Admin API Bucket Postgres Database Cronjob Ingress FA Service

    API Service What have we done? @AuroreMalherbes @MaximeSraiki
  18. Forest Admin API Bucket Postgres Database Cronjob Ingress FA Service

    API Service What have we done? @AuroreMalherbes @MaximeSraiki
  19. Do some maths for your cronjobs @AuroreMalherbes @MaximeSraiki ➔ Before:

    • 2.5 CPUs for 3 APIs (and 1 BDD) ⇒ 1.12 CPU/API
  20. Do some maths for your cronjobs @AuroreMalherbes @MaximeSraiki ➔ Before:

    • 2.5 CPUs for 3 APIs (and 1 BDD) ⇒ 1.12 CPU/API ➔ After: • 12 CPUs for 9 APIs ⇒ 1.33 CPU/API
  21. Do some maths for your cronjobs @AuroreMalherbes @MaximeSraiki ➔ Before:

    • 2.5 CPUs for 3 APIs (and 1 BDD) ⇒ 1.12 CPU/API ➔ After: • 12 CPUs for 9 APIs ⇒ 1.33 CPU/API • 12 CPUs for 9 APIs and up to 10 crons !!!
  22. Forest Admin API Bucket Postgres Database Cronjob Ingress FA Service

    API Service What have been changed since? @AuroreMalherbes @MaximeSraiki Push engine PE Service Redis Worker
  23. Key takeaways @AuroreMalherbes @MaximeSraiki ⇒ You can not plan everything,

    so plan it! ⇒ One thing at a time ⇒ Doing things right open up new horizons